ai-yang opened a new pull request, #10751: URL: https://github.com/apache/rocketmq/pull/10751
### Which Issue(s) This PR Fixes Fixes #10750 ### Brief Description `PopConsumerLockService.removeTimeout()` previously made its expiration decision before removing the map entry. A concurrent `tryLock()` could reacquire the same `TimedLock` and refresh its timestamp after that decision, but cleanup would still remove the refreshed entry and allow a second holder to be created. This change makes acquisition/refresh and the authoritative cleanup recheck atomic for each key: - `tryLock()` uses `ConcurrentHashMap.compute()` to select/create and acquire the mapped lock within the per-key remapping boundary. - `removeTimeout()` uses `computeIfPresent()` to recheck the current lock timestamp before removing it. - Existing behavior for leases that remain expired at the authoritative recheck is preserved. ### How Did You Test This Change? - Unmodified `develop`: the deterministic latch regression failed in 5/5 isolated JDK 8 Maven processes; an independent rerun also failed 5/5. - Fixed targeted test class: 20 isolated JDK 8 Maven processes, 2/2 each (40/40 total). - Full `broker -am test`: all 10 reactor modules passed; broker ran 753 tests with 0 failures, 0 errors, and 4 skips. - Checkstyle: 0 violations. - SpotBugs: 0 bugs/errors. - `git diff --check`: passed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
