-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(NODE-6258): add signal support to find and aggregate #4364
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addaleax
reviewed
Jan 8, 2025
nbbeeken
force-pushed
the
NODE-6258-abortsignal
branch
2 times, most recently
from
January 14, 2025 20:05
d1b4562
to
9b76e10
Compare
nbbeeken
force-pushed
the
NODE-6258-abortsignal
branch
from
January 14, 2025 21:09
d18a156
to
a2af7ed
Compare
nbbeeken
force-pushed
the
NODE-6258-abortsignal
branch
7 times, most recently
from
January 15, 2025 18:30
c05a69d
to
a68b3cb
Compare
nbbeeken
force-pushed
the
NODE-6258-abortsignal
branch
from
January 15, 2025 20:33
a68b3cb
to
d5ed413
Compare
nbbeeken
force-pushed
the
NODE-6258-abortsignal
branch
from
January 15, 2025 20:42
d5ed413
to
ab02d53
Compare
baileympearson
requested changes
Jan 16, 2025
baileympearson
added
the
Primary Review
In Review with primary reviewer, not yet ready for team's eyes
label
Jan 16, 2025
baileympearson
requested changes
Jan 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor clarification
W-A-James
previously approved these changes
Jan 24, 2025
baileympearson
approved these changes
Jan 25, 2025
nbbeeken
added
Team Review
Needs review from team
and removed
Primary Review
In Review with primary reviewer, not yet ready for team's eyes
labels
Jan 27, 2025
W-A-James
approved these changes
Jan 27, 2025
W-A-James
approved these changes
Jan 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
What is changing?
Is there new documentation needed for these changes?
Yes, API docs.
What is the motivation for this change?
AbortController/AbortSignal has become the defacto interruption mechanism for async operations. We're starting small by linking an abort signal to the lifetime of a cursor so that .next() / toArray() / for-await usage can be interrupted by external means.
Release Highlight
🧪 Experimental AbortSignal support added to Find and Aggregate! 🚥
A
signal
argument can now be passed to the following APIs:collection.find()
&collection.findOne()
collection.aggregate()
&collection.countDocuments()
In order to support field level encryption properly, also:
db.listCollections()
db.command()
When aborted, the signal will interrupt the execution of each of each of these APIs. For the cursor-based APIs, this will be observed when attempting to consume from the cursor via toArray(), next(), for-await, etc.
There is a known limitation: aborting a signal closes a perfectly healthy connection which can cause unnecessary connection reestablishment so we're releasing this as experimental for evaluation in use cases that can tolerate the shortcoming.
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript