-
Notifications
You must be signed in to change notification settings - Fork 31
feat: Graceful session pool shutdown #623
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
Open
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
db92b17
refactor(session-pool): route DeleteSession through worker
aral01 9a80c69
feat(client): await session cleanup during shutdown
aral01 188857a
feat(query): await rollback-on-drop during shutdown
aral01 8d733ee
fix(session-pool): drain recursively submitted cleanup
aral01 ce30175
fix(query): rollback transient transaction failures
aral01 2aaf693
fix(session-pool): bound cleanup connection acquisition
aral01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] This only shuts down the currently configured pool.
with_session_poolreplacesself.session_poolwithout shutting down or retaining the previous pool, while query/table clients created before replacement keep clones of that old pool. Consequently, after reconfiguration this method can return while old leases and cleanup tasks are still active, and those older clients can still acquire sessions. That defeats the documented shutdown guarantee and can still lose cleanup when the runtime is dropped. Please include superseded pools in the shutdown lifecycle or shut down the old pool during replacement.— 🤖 AI review on behalf of @rekby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still applies at the current head:
with_session_poolreplaces the field viaSelf { session_pool, ..self }, whileshutdownonly awaitsself.session_pool.shutdown(). A previously createdQueryClientorTableClienttherefore retains an untracked clone of the superseded pool and can keep acquiring sessions after this shutdown returns.— 🤖 AI review on behalf of @rekby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still unresolved at
f60ecbf: the new commit only bounds cleanup connection acquisition;with_session_poolstill replaces the pool, andshutdownstill awaits only the replacement. Previously derived clients can therefore retain and use the superseded pool.— 🤖 AI review on behalf of @rekby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still unresolved at
97be54b3:with_session_poolstill replaces the field withSelf { session_pool, ..self }, whileshutdownawaits only that replacement. A query/table client created before replacement therefore retains the superseded pool and can continue acquiring sessions after this shutdown completes.— 🤖 AI review on behalf of @rekby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still unresolved at
ac216fe: this push only changes cleanup timeout coverage.with_session_poolstill replaces the pool viaSelf { session_pool, ..self }, whileshutdownawaits onlyself.session_pool. Query/table clients created before replacement therefore retain the original pool and can still acquire sessions after shutdown returns.— 🤖 AI review on behalf of @rekby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still unresolved at
2aaf6938:with_session_poolcontinues to replace the field viaSelf { session_pool, ..self }, whileshutdownonly awaits the replacement. A query/table client created before replacement therefore retains the superseded pool and can keep acquiring sessions after shutdown returns.— 🤖 AI review on behalf of @rekby