Skip to content

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

Open

Description

@Metastarx

ReceiptHandleGroup.put() at lines 179-196, get() at lines 222-236, remove() at lines 247-261, and computeIfPresent() at lines 293-318 all call HandleData.lock(). When tryAcquire() times out, lock() treats a stale lastLockTimeMs as success at lines 124-131, updates the timestamp, and returns without acquiring the semaphore. The caller then enters the critical section concurrently with the original holder. Its finally block calls unlock(), which releases the semaphore at lines 141-148 even though this recovery path never acquired it; multiple waiters can therefore inflate the permit count and allow later receipt-handle updates or removals to run concurrently.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions