Repository navigation
fix(proxy): self-heal Prisma connection for auth and runtime #21706
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e6f894d
fix(proxy): add prisma reconnect primitive and db watchdog
ishaan-jaff d1b2805
fix(proxy): start and stop prisma watchdog in lifecycle
ishaan-jaff ffe8637
fix(auth): retry key lookup once after prisma reconnect
ishaan-jaff 4dee7dc
test(proxy): add prisma self-heal watchdog coverage
ishaan-jaff b560164
test(auth): cover reconnect-once behavior for key lookup
ishaan-jaff cb19ec1
refactor(auth): extract db reconnect helper and remove inline import
ishaan-jaff e89c5b7
fix(proxy): apply reconnect cooldown after attempt and add auth timeo…
ishaan-jaff 14f529a
fix(auth): bound reconnect latency on key lookup path
ishaan-jaff 5e0fbf0
test(auth): assert reconnect timeout argument in key lookup
ishaan-jaff 67809b8
test(proxy): verify reconnect cooldown timestamp set after attempt
ishaan-jaff edcb6bd
fix(proxy): harden prisma reconnect cycle semantics
ishaan-jaff 1144b7f
test(proxy): cover watchdog reconnect + timeout budget
ishaan-jaff 1921bad
fix(proxy): bound watchdog probe and reconnect paths
ishaan-jaff 2083f39
test(proxy): cover watchdog timeout and probe behavior
ishaan-jaff 2c02d1e
fix(proxy): narrow prisma db connection error classification
ishaan-jaff c0a395a
fix(proxy): add auth reconnect lock timeout budget
ishaan-jaff 4844f76
fix(auth): pass lock timeout for db reconnect retries
ishaan-jaff 3bb2423
test(proxy): cover narrow prisma connection error detection
ishaan-jaff f288319
test(proxy): add reconnect lock-timeout behavior coverage
ishaan-jaff b53c342
test(auth): assert reconnect lock timeout argument
ishaan-jaff aa71695
fix(proxy): avoid lock leak race in reconnect lock timeout path
ishaan-jaff 8b8c58a
test(proxy): cover reconnect lock-timeout race cleanup
ishaan-jaff 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.
Watchdog health_check uses backoff retries before reaching reconnect
health_check()is decorated with@backoff.on_exception(max_tries=3, max_time=10), so each watchdog iteration will retry the health check with exponential backoff for up to 10 seconds before the exception propagates here. Combined with the unboundedattempt_db_reconnectcall, a single watchdog cycle when the DB is down could take 10s (health_check retries) + unbounded time (reconnect with no timeout) before the loop can sleep and try again.Consider calling
self.db.query_raw("SELECT 1")directly instead ofself.health_check()to avoid the backoff retries in the watchdog loop, since the watchdog already has its own retry-via-sleep cadence.