Skip to content

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

@leizhiyuan

Description

@leizhiyuan

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.

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

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