Skip to content
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

refactor(NODE-6411): AbstractCursor accepts an external timeout context #4264

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Oct 2, 2024

Description

What is changing?

The abstract cursor now accepts an external timeout. This lets operations which create cursors share their timeout contexts with the abstract cursor. This required a handful of changes:

  1. this can only be used in CURSOR_LIFETIME, since ITERATION mutates the timeout context after each operation
  2. killcursors now refreshes the timeout context without mutating it using the new refreshed method

I also removed some usages of isCSOTEnabled() by adding a maxTimeMS property to the TimeoutContext. We can iterate on this and remove omitMaxTimeMS too if we want by making cursors conditionally return null when they should not set maxTimeMS, but I considered this out of scope for this PR.

Is there new documentation needed for these changes?

What is the motivation for this change?

Release Highlight

Fill in title or leave empty for no highlight

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@baileympearson baileympearson changed the title feat(NODE-6090): Implement CSOT logic for connection checkout and ser… refactor(NODE-6411): Make the abstract cursor accept an external timeout context Oct 2, 2024
@baileympearson baileympearson changed the title refactor(NODE-6411): Make the abstract cursor accept an external timeout context refactor(NODE-6411): AbstractCursor accepts an external timeout context Oct 4, 2024
);
}
this.cursorOptions.timeoutMode = options.timeoutMode;
if (options.tailable && this.cursorOptions.timeoutMode === CursorTimeoutMode.LIFETIME) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a bit of cleanup, happy to revert.

@baileympearson baileympearson marked this pull request as ready for review October 4, 2024 15:40
@W-A-James W-A-James self-assigned this Oct 4, 2024
@W-A-James W-A-James self-requested a review October 4, 2024 15:57
@W-A-James W-A-James added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Oct 4, 2024
@W-A-James W-A-James added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Oct 4, 2024
@W-A-James W-A-James merged commit 392599c into NODE-6090 Oct 4, 2024
24 of 27 checks passed
@W-A-James W-A-James deleted the NODE-6411 branch October 4, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants