Why are the conditions for lock and unlock multiplied by 2 and 3 respectively? It seems a bit strange.
这里*2 和 *3 似乎有点奇怪,不知道是不是写错了。
|
long expiredTimeMs = ConfigurationManager.getProxyConfig().getLockTimeoutMsInHandleGroup() * 3; |
|
if (System.currentTimeMillis() - lockTimeMs > ConfigurationManager.getProxyConfig().getLockTimeoutMsInHandleGroup() * 2) { |
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.
另外,应该判断时间,再获取锁,否则队列堆积的时候,会越来越慢,无法把过期的快速处理掉。