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-5912): make server.command an async function #3986

Merged
merged 25 commits into from
Feb 23, 2024

Conversation

W-A-James
Copy link
Contributor

@W-A-James W-A-James commented Feb 8, 2024

Description

What is changing?

  • Server.command is now written with explicit async/await syntax
  • Removed Server.commandAsync and replaced all references
  • Removed ConnectionPool.withConnection, ConnectionPool.withReauthentiation
  • Refactored ConnectionPool.reauthenticate to use explicit async/await syntax and exported it for internal use in Server.command
  • Refactored ConnectionPool.checkOut to use async/await syntax with the support of promiseWithResolvers helper function
  • Removed callback property from WaitQueueMember and replaced it with explicit reject and resolve properties for more ergonomic use with promiseWithResolvers in ConnectionPool.checkOut

What is the motivation for this change?

NODE-5912, NODE-5913

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

src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
@W-A-James
Copy link
Contributor Author

Currently only consistently failing these two tests across load-balanced variants. It seems strange to me that we'd fail operation count tests, but not connection pinning tests.

@nbbeeken nbbeeken force-pushed the NODE-5912/server-command-async-await branch from 8e5d24b to 7400c87 Compare February 21, 2024 21:54
@nbbeeken nbbeeken marked this pull request as ready for review February 21, 2024 23:04
@nbbeeken nbbeeken changed the title refactor(NODE-5912): Refactor Server.command to use async/await refactor(NODE-5912): make server.command an async function Feb 21, 2024
@alenakhineika alenakhineika self-assigned this Feb 22, 2024
@alenakhineika alenakhineika added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Feb 22, 2024
@alenakhineika
Copy link
Contributor

A couple of housekeeping questions:

  • Does this PR also cover NODE-5913? If so to not forget to close that ticket as well and maybe mention its number in the current PR.
  • Double-check the list in the PR description to see if it meets all expectations.

alenakhineika
alenakhineika previously approved these changes Feb 22, 2024
@alenakhineika alenakhineika 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 22, 2024
src/cmap/connection_pool.ts Outdated Show resolved Hide resolved
src/cmap/connection_pool.ts Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/server.ts Show resolved Hide resolved
src/sdam/server.ts Outdated Show resolved Hide resolved
src/sdam/topology.ts Show resolved Hide resolved
test/integration/crud/abstract_operation.test.ts Outdated Show resolved Hide resolved
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.

pending CI, LGTM

@alenakhineika
Copy link
Contributor

CI fails because the AWS Secrets Secrets Manager is not implemented yet NODE-5507 and Serverless credentials are rotated (should be fixed soon).

@alenakhineika alenakhineika merged commit ff8b5f5 into main Feb 23, 2024
23 of 27 checks passed
@alenakhineika alenakhineika deleted the NODE-5912/server-command-async-await branch February 23, 2024 15:35
@alenakhineika alenakhineika removed the Team Review Needs review from team label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants