apache / apache/rocketmq

[Enhancement] Why are the conditions for lock and unlock multiplied by 2 and 3 respectively? It seems a bit strange.

Open
#10,065 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
2d 20h
Merged PRs (30d)
26

Description

Why are the conditions for lock and unlock multiplied by 2 and 3 respectively? It seems a bit strange.

这里*2 和 *3 似乎有点奇怪,不知道是不是写错了。

https://github.com/apache/rocketmq/blob/10c650c48724d052b1b5c6406b8c28cbcd86d3bf/proxy/src/main/java/org/apache/rocketmq/proxy/common/ReceiptHandleGroup.java#L123

https://github.com/apache/rocketmq/blob/10c650c48724d052b1b5c6406b8c28cbcd86d3bf/proxy/src/main/java/org/apache/rocketmq/proxy/common/ReceiptHandleGroup.java#L143

In addition, the time should be checked before acquiring the lock; otherwise, as the queue accumulates, it will become increasingly slow and unable to quickly process expired items.

另外,应该判断时间,再获取锁,否则队列堆积的时候,会越来越慢,无法把过期的快速处理掉。

Contributor guide

Open the contributing guide

Research direction

Start in proxy/src/main/java/org/apache/rocketmq/proxy/common/ReceiptHandleGroup.java at the referenced lines 123 and 143. Trace the lock and unlock conditions and the time check while considering queue accumulation; done means the multiplier behavior and lock ordering are confirmed or corrected, with the resulting expired-item processing verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
57/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.