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-4413): set maxTimeMS on getMores when maxAwaitTimeMS is specified #3319

Merged
merged 12 commits into from Aug 10, 2022

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Jul 13, 2022

Description

What is changing?

  • Capture maxAwaitTimeMS option on cursor options
  • Add documentation to options
  • Move error handling to getMore.execute (I can put this back, it seems like the right place in terms of handling issues)
  • GetMore constructor must always take in options
  • Added tests to maxTimeMS.test.ts and converted to TS
  • Added tests to change streams.

What is the motivation for this change?

Fix maxAwaitTimeMS not being respected by change stream getMores (all getMores were impacted actually)

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>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken force-pushed the NODE-4173/test-maxAwaitTimeMS branch 2 times, most recently from aeabbd7 to ef2ea17 Compare July 14, 2022 20:43
@nbbeeken nbbeeken force-pushed the NODE-4173/test-maxAwaitTimeMS branch 2 times, most recently from 74fdbb3 to f8647fa Compare July 27, 2022 19:40
@nbbeeken nbbeeken force-pushed the NODE-4173/test-maxAwaitTimeMS branch from 02c678a to 7a23092 Compare August 1, 2022 14:27
@nbbeeken nbbeeken changed the title WIP(NODE-4393): maxAwaitTimeMS fix(NODE-4393): set maxTimeMS on getMores when maxAwaitTimeMS is specified Aug 1, 2022
@nbbeeken nbbeeken marked this pull request as ready for review August 1, 2022 19:12
@baileympearson baileympearson changed the title fix(NODE-4393): set maxTimeMS on getMores when maxAwaitTimeMS is specified fix(NODE-4173): set maxTimeMS on getMores when maxAwaitTimeMS is specified Aug 2, 2022
@baileympearson baileympearson changed the title fix(NODE-4173): set maxTimeMS on getMores when maxAwaitTimeMS is specified fix(NODE-4413): set maxTimeMS on getMores when maxAwaitTimeMS is specified Aug 2, 2022
test/integration/crud/maxTimeMS.test.ts Outdated Show resolved Hide resolved
test/integration/crud/maxTimeMS.test.ts Show resolved Hide resolved
Comment on lines +648 to +649
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const getMoreOperation = new GetMoreOperation(this[kNamespace], this[kId]!, this[kServer]!, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have tests that test for errors being thrown when execute is called on a zero-ed cursor or if the server is undefined? If not, can we add them to demonstrate this behavior still exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added! :)

@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Aug 2, 2022
@nbbeeken nbbeeken requested review from baileympearson and dariakp and removed request for baileympearson August 3, 2022 19:55
@nbbeeken nbbeeken force-pushed the NODE-4173/test-maxAwaitTimeMS branch from ac2b000 to 7b956a2 Compare August 4, 2022 17:36
test/unit/operations/get_more.test.ts Show resolved Hide resolved
test/integration/crud/maxTimeMS.test.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken force-pushed the NODE-4173/test-maxAwaitTimeMS branch from 0e2117d to 83c1b56 Compare August 9, 2022 18:16
@dariakp dariakp removed the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Aug 9, 2022
@dariakp dariakp added the Team Review Needs review from team label Aug 9, 2022
.expectEvents({
client: 'client0',
events: [
{ commandStartedEvent: { commandName: 'aggregate' } },
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we assert absence of the prop on the getMore in the 2nd case, but not on the initial aggregate here? what's the actual expected behavior from these options in the two cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an (not) existence check, and clarified the titles

@baileympearson baileympearson merged commit dcbfd6e into main Aug 10, 2022
@baileympearson baileympearson deleted the NODE-4173/test-maxAwaitTimeMS branch August 10, 2022 19:32
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
3 participants