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

feat(NODE-3697): reduce serverSession allocation #3171

Merged
merged 14 commits into from
Mar 25, 2022

Conversation

nbbeeken
Copy link
Contributor

Description

What is changing?

  • incrementTransactionNumber will no longer acquire a serverSession because it won't use the getter

What is the motivation for this change?

With this change our driver will only acquire a serverSession when the getter is used which is in applySession, used inside the Connection class. This limits the number of serverSession allocated to be bounded by at least the number of concurrent operations running and at best by the max number of connection in our connectionPool.

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-3697/implicit-session-acquire-after-checkout branch from a3dc79f to ff5b12e Compare March 14, 2022 18:50
@nbbeeken nbbeeken force-pushed the NODE-3697/implicit-session-acquire-after-checkout branch from ff5b12e to 8f7c72a Compare March 15, 2022 19:01
@nbbeeken nbbeeken marked this pull request as ready for review March 15, 2022 19:24
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 16, 2022
test/integration/sessions/sessions.test.ts Outdated Show resolved Hide resolved
src/sessions.ts Show resolved Hide resolved
src/sessions.ts Outdated Show resolved Hide resolved
src/sessions.ts Show resolved Hide resolved
src/sessions.ts Show resolved Hide resolved
@baileympearson baileympearson added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Mar 17, 2022
@nbbeeken nbbeeken requested review from dariakp and durran March 17, 2022 22:38
@dariakp
Copy link
Contributor

dariakp commented Mar 18, 2022

I'm sorry I haven't gotten around to a review yet, but it's on my list to do Monday!

test/unit/sessions.test.js Outdated Show resolved Hide resolved
test/unit/sessions.test.js Outdated Show resolved Hide resolved
test/integration/sessions/sessions.spec.prose.test.ts Outdated Show resolved Hide resolved
src/sessions.ts Show resolved Hide resolved
src/sessions.ts Outdated Show resolved Hide resolved
src/sessions.ts Outdated Show resolved Hide resolved
src/sessions.ts Outdated Show resolved Hide resolved
src/sessions.ts Outdated Show resolved Hide resolved
src/sessions.ts Outdated Show resolved Hide resolved
src/sessions.ts Show resolved Hide resolved
@nbbeeken nbbeeken requested a review from dariakp March 23, 2022 15:10
Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

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

Much easier to follow the tests now, thanks! I resolved the comments that have been addressed, there are 2 comments with active discussions left, and I noticed a couple more nits here:

src/sessions.ts Outdated Show resolved Hide resolved
test/unit/sessions.test.js Show resolved Hide resolved
test/unit/sessions.test.js Outdated Show resolved Hide resolved
test/unit/sessions.test.js Show resolved Hide resolved
@nbbeeken nbbeeken requested a review from dariakp March 24, 2022 20:23
test/unit/sessions.test.js Show resolved Hide resolved
test/unit/sessions.test.js Outdated Show resolved Hide resolved
test/unit/sessions.test.js Outdated Show resolved Hide resolved
test/unit/sessions.test.js Show resolved Hide resolved
test/unit/sessions.test.js Show resolved Hide resolved
@nbbeeken nbbeeken requested a review from dariakp March 25, 2022 20:51
Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

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

LGTM assuming CI passes!

@dariakp dariakp dismissed baileympearson’s stale review March 25, 2022 22:00

Bailey LGTMed given pipeline pass

@dariakp dariakp merged commit 5132bc9 into main Mar 25, 2022
@dariakp dariakp deleted the NODE-3697/implicit-session-acquire-after-checkout branch March 25, 2022 22:01
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