test(txn): pin that commit retry exhaustion rejects the awaited request chain#1861
Open
kriszyp wants to merge 4 commits into
Open
test(txn): pin that commit retry exhaustion rejects the awaited request chain#1861kriszyp wants to merge 4 commits into
kriszyp wants to merge 4 commits into
Conversation
…st chain Investigating harper#1785's follow-up (retry-exhaustion error never reaches the caller): on main the propagation is intact — these tests pin it so it stays that way. All three native conflict-signaling paths are covered (ERR_TRY_AGAIN, ERR_BUSY, coordinated RETRY_NOW): the awaited transaction() promise must reject with the ServerError (statusCode 500) after exactly MAX_RETRIES + 1 attempts, within bounded time, with no unhandled rejection. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s (cross-model review) Codex review: unhandledRejection is delivered on a later event-loop turn, so asserting immediately (and removing the listener in the after hook) could let a leaked rejection escape the check. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…el review) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new test suite, requestPathRetryExhaustion.test.js, to verify that request-path transactions reject properly with a 500 ServerError when commit retries are exhausted, preventing silent hangs. The review feedback highlights two important improvements: first, managing prototype stub cleanups via an afterEach hook to prevent test pollution in case of timeouts; second, configuring the background delay timers with { ref: false } to ensure they do not keep the Node.js event loop active after the tests finish.
Contributor
|
Reviewed; no blockers found. |
… review) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kriszyp
marked this pull request as ready for review
July 18, 2026 14:28
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.
Summary
Test-only. Closes out the #1785 follow-up ("retry-exhaustion error never reaches the HTTP caller"): investigation showed the propagation is intact on main — the 5.1.19 field symptom was retry-cycle latency (pre-#1696 per-record txn-log scans blocking the event loop) outliving the client's socket, not a swallowed rejection. These tests pin the invariant so it stays true:
ERR_TRY_AGAIN,ERR_BUSYrejections; coordinatedRETRY_NOWsentinel) reject the awaitedtransaction()promise with the ServerError (statusCode 500) after exactlyMAX_RETRIES + 1native attempts, in bounded time, with no unhandled rejection.Where to look
MAX_RETRY_DELAY_MSoverride are the alternatives (raised by the Gemini review; left as-is intentionally).hdb_analyticsaggregation transactions, which spawn their own 40-retry chains and pollute the attempt count (708 attempts observed).Generated by an LLM (Claude Fable 5), supervised by Kris.
🤖 Generated with Claude Code