retries for alembic migration for authn on startup - #1446
Open
swelborn wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
closes #1447 |
swelborn
force-pushed
the
fix-thundering-herd-authn-startup
branch
from
July 23, 2026 14:50
dd353bd to
8cec6c6
Compare
Member
|
Thanks for moving it outside the app startup code; I agree that that has overgrown and become hard to read. I wonder if, instead of retries, we should aim for |
Contributor
Author
|
good morning dan do you mean to move the subprocess in-process? trying to think about which replica grabs the lock to do the table creation + alembic upgrade + role creation + stamp version, and how the lock is held thru that process, without some exception handling like we have in this retry code |
added 3 commits
July 29, 2026 13:25
this fix mitigates thundering herd problem when bringing up multiple replicas of the server. we could do this with a lock, but we want to make sure sqlite and other dialects work. so we add a retry mechanism for when things fail
swelborn
force-pushed
the
fix-thundering-herd-authn-startup
branch
from
July 29, 2026 17:28
8cec6c6 to
00dd73b
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
added this retry code to startup to try and try again if we have many replicas on startup. this should mitigate having to bootstrap a cluster manually with 1 replica on, then spinning up more.
not sure if the code is in the right place. tried conforming to lazy imports, but moved function outside of deeply nested app startup code. since that is tough to read.
Checklist