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

fix(NODE-5052): prevent cursor and changestream close logic from running more than once #3562

Merged
merged 30 commits into from Feb 14, 2023

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Feb 9, 2023

Description

What is changing?

  • Gate the killCursor cleanup logic on the closed flag to not send the command if cleanup has already run
  • Add unhandled error checkers

What is the motivation for this change?

Fix an unhandled promise rejection from killCursors attempting to use a session that has expired.

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

@nbbeeken nbbeeken marked this pull request as ready for review February 9, 2023 18:12
@nbbeeken nbbeeken force-pushed the NODE-5052-close-change-stream branch from e79da44 to 0a3bd27 Compare February 9, 2023 18:12
@dariakp dariakp added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Feb 10, 2023
src/cursor/abstract_cursor.ts Outdated Show resolved Hide resolved
src/cursor/abstract_cursor.ts Outdated Show resolved Hide resolved
test/integration/change-streams/change_stream.test.ts Outdated Show resolved Hide resolved
test/integration/crud/crud_api.test.ts Outdated Show resolved Hide resolved
test/integration/crud/crud_api.test.ts Outdated Show resolved Hide resolved
test/integration/crud/crud_api.test.ts Outdated Show resolved Hide resolved
test/integration/crud/crud_api.test.ts Outdated Show resolved Hide resolved
test/integration/crud/crud_api.test.ts Outdated Show resolved Hide resolved
test/integration/crud/find_cursor_methods.test.js Outdated Show resolved Hide resolved
test/integration/crud/find_cursor_methods.test.js Outdated Show resolved Hide resolved
nbbeeken and others added 3 commits February 10, 2023 12:56
Co-authored-by: Durran Jordan <durran@gmail.com>
@dariakp dariakp added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Feb 10, 2023
test/tools/runner/hooks/unhandled_checker.ts Outdated Show resolved Hide resolved
test/integration/crud/find_cursor_methods.test.js Outdated Show resolved Hide resolved
test/integration/crud/find_cursor_methods.test.js Outdated Show resolved Hide resolved
test/integration/crud/find_cursor_methods.test.js Outdated Show resolved Hide resolved
test/integration/crud/crud_api.test.ts Outdated Show resolved Hide resolved
test/integration/change-streams/change_stream.test.ts Outdated Show resolved Hide resolved
test/integration/change-streams/change_stream.test.ts Outdated Show resolved Hide resolved
test/integration/change-streams/change_stream.test.ts Outdated Show resolved Hide resolved
test/integration/change-streams/change_stream.test.ts Outdated Show resolved Hide resolved
@dariakp dariakp added the wip label Feb 10, 2023
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

I think my comment got lost here - #3562 (comment)

src/cursor/abstract_cursor.ts Outdated Show resolved Hide resolved
@dariakp dariakp removed the wip label Feb 13, 2023
@dariakp dariakp merged commit 71d0d79 into main Feb 14, 2023
@dariakp dariakp deleted the NODE-5052-close-change-stream branch February 14, 2023 14:59
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
4 participants