Skip to content

Keep receipt handle lock ownership until renewal completes - #11543

Open
Metastarx wants to merge 1 commit into
apache:developfrom
Metastarx:patch/proxy-src-main-java-org-apache-rocketmq-
Open

Metastarx wants to merge 1 commit into
apache:developfrom
Metastarx:patch/proxy-src-main-java-org-apache-rocketmq-

Conversation

@Metastarx

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

A receipt-handle lock waiter could time out, enter without acquiring the semaphore, and then release a permit it never held. The timeout now limits only how long a caller waits, so put, get, remove, and renewal cannot take ownership from a pending renewal. A renewal releases its permit when its future completes, and a callback that throws before returning a future releases it immediately. I verified that concurrent callers time out while renewal is pending, that completion restores exactly one permit, and that both callback failure paths leave the handle usable.

How Did You Test This Change?

mvn test -pl proxy - passed (Tests run: 466, Failures: 0, Errors: 0, Skipped: 3)

Signed-off-by: zhang hongyuan <100520587+Metastarx@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 14:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.14607% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.87%. Comparing base (28960fd) to head (65a6205).

Files with missing lines Patch % Lines
...ache/rocketmq/proxy/common/ReceiptHandleGroup.java 81.25% 9 Missing and 3 partials ⚠️
...y/service/receipt/DefaultReceiptHandleManager.java 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #11543      +/-   ##
=============================================
+ Coverage      49.86%   49.87%   +0.01%     
- Complexity     14454    14456       +2     
=============================================
  Files           1391     1391              
  Lines         103432   103456      +24     
  Branches       13550    13549       -1     
=============================================
+ Hits           51573    51601      +28     
+ Misses         45636    45626      -10     
- Partials        6223     6229       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proxy/src/main/java/org/apache/rocketmq/proxy/common/ReceiptHandleGroup.java:124 - expired-lock recovery bypasses semaphore acquisition

3 participants