Repository navigation
[ISSUE #10225] Avoid waiting on expired receipt handle locks - #11503
Open
qianye1001 wants to merge 3 commits into
Open
qianye1001 wants to merge 3 commits into
qianye1001 wants to merge 3 commits into
Conversation
qianye1001
force-pushed
the
codex/receipt-handle-lock-lease
branch
from
November 3, 2026 03:49
e69605e to
23d8956
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11503 +/- ##
=============================================
- Coverage 49.91% 49.83% -0.09%
+ Complexity 14442 14409 -33
=============================================
Files 1391 1391
Lines 103362 103375 +13
Branches 13519 13521 +2
=============================================
- Hits 51598 51519 -79
- Misses 45572 45643 +71
- Partials 6192 6213 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which Issue(s) This PR Fixes
Fixes #10225
Brief Description
An already expired receipt handle lock currently incurs a full semaphore wait before the caller checks expiration. Follow the approach in #10226: try acquiring without waiting, check expiration before the timed acquire, and retain the expiration check after a timed acquire fails.
Use
lockExpiredTimeMsInHandleGroup(default: 4000 ms) for both takeover and stale unlock rejection. The renewal RPC defaults to a 2-second timeout. Using the same threshold for unlock prevents a previous holder from releasing the semaphore after takeover at the default 4 seconds while still within the former 6-second release window.The zero-wait acquire uses the interruptible overload to preserve existing interruption behavior. Acquisition timestamps are recorded after the acquire attempt. The change is confined to
ReceiptHandleGroup, its existing test class andProxyConfig.How Did You Test This Change?
Added regressions for interrupt handling, the 4000 ms default, a custom 8000 ms expiration threshold, immediate takeover after expiration, rejection of the old holder's unlock, and normal release by the new holder. The expiration test sets the existing timestamp directly instead of sleeping at the expiration boundary.
Passed 22 focused tests, with 0 failures, 0 errors and 0 skipped:
mvn -B -pl proxy -am -DskipITs -DfailIfNoTests=false \ -Djacoco.skip=true -Dnet.bytebuddy.experimental=true \ -Dtest=ReceiptHandleGroupTest,DefaultReceiptHandleManagerTest,ReceiptHandleProcessorTest \ testCheckstyle, SpotBugs and
git diff --checkpassed. Local validation used JDK 21 and Maven 3.9.9; the two compatibility flags accommodate the repository's existing JaCoCo/Byte Buddy versions. No throughput benchmark was run.