[
https://issues.apache.org/jira/browse/HADOOP-19899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18082631#comment-18082631
]
ASF GitHub Bot commented on HADOOP-19899:
-----------------------------------------
adoroszlai opened a new pull request, #8507:
URL: https://github.com/apache/hadoop/pull/8507
## What changes were proposed in this pull request?
Sleep period in `RetryInvocationHandler` should be `waitTime`, not `delay`.
1. `RetryInfo.retryTime` is calculated when it is created:
https://github.com/apache/hadoop/blob/71d216d8c80e7e2682471a2b9819c36a1558033d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java#L252-L253
2. `waitTime` is calculated before `sleep` as:
https://github.com/apache/hadoop/blob/71d216d8c80e7e2682471a2b9819c36a1558033d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java#L84-L85
3. but then original `RetryInfo.delay` is used for actual sleep time:
https://github.com/apache/hadoop/blob/71d216d8c80e7e2682471a2b9819c36a1558033d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java#L130-L135
https://issues.apache.org/jira/browse/HADOOP-19899
## How was this patch tested?
https://github.com/adoroszlai/hadoop/actions/runs/26225351328
> Fix sleep time in RetryInvocationHandler
> ----------------------------------------
>
> Key: HADOOP-19899
> URL: https://issues.apache.org/jira/browse/HADOOP-19899
> Project: Hadoop Common
> Issue Type: Bug
> Components: common
> Reporter: Attila Doroszlai
> Assignee: Attila Doroszlai
> Priority: Minor
>
> Sleep period in {{RetryInvocationHandler}} should be {{waitTime}}, not
> {{delay}}:
> {code:title=https://github.com/apache/hadoop/blob/71d216d8c80e7e2682471a2b9819c36a1558033d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java#L130-L135}
> final Long waitTime = getWaitTime(Time.monotonicNow());
> LOG.trace("#{} processRetryInfo: retryInfo={}, waitTime={}",
> callId, retryInfo, waitTime);
> if (waitTime != null && waitTime > 0) {
> try {
> Thread.sleep(retryInfo.delay);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]