![image](https://user-images.githubusercontent.com/42512469/190078802-e1818b47-5905-4452-86cf-25ce70b4174f.png)


![image](https://user-images.githubusercontent.com/42512469/190079027-44af1591-cc7b-4149-ba93-ffbbef238038.png)

logger.warn(t.getMessage(), t);
                }
            } finally {
                destroyLock.unlock();
            }
        }
    }
    private int calculateTimeout(Invocation invocation, String methodName) {
        if (invocation.getObjectAttachment(TIMEOUT_KEY) != null) {
            return (int) invocation.getObjectAttachment(TIMEOUT_KEY);
        }
        Object countdown = RpcContext.getClientAttachment().getObjectAttachment(TIME_COUNTDOWN_KEY);
        int timeout;
        if (countdown == null) {
            timeout = (int) RpcUtils.getTimeout(getUrl(), methodName,
                RpcContext.getClientAttachment(), 3000);
            if (getUrl().getParameter(ENABLE_TIMEOUT_COUNTDOWN_KEY, false)) {
                invocation.setObjectAttachment(TIMEOUT_ATTACHMENT_KEY,
                    timeout); 
            }
        } else {
            TimeoutCountDown timeoutCountDown = (TimeoutCountDown) countdown;
            timeout = (int) timeoutCountDown.timeRemaining(TimeUnit.MILLISECONDS);
            invocation.setObjectAttachment(TIMEOUT_ATTACHMENT_KEY,
                timeout);
        }
        return timeout;
    }
}