Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClusterMergeTask::waitOnFutureInterruptible has an (almost) endless loop #8527

Closed
juanavelez opened this issue Jul 14, 2016 · 0 comments · Fixed by #8529
Closed

ClusterMergeTask::waitOnFutureInterruptible has an (almost) endless loop #8527

juanavelez opened this issue Jul 14, 2016 · 0 comments · Fixed by #8529
Assignees
Labels
Source: Community PR or issue was opened by a community user Team: Core Type: Defect
Milestone

Comments

@juanavelez
Copy link

    private <V> V waitOnFutureInterruptible(Future<V> future, long timeout, TimeUnit timeUnit)
            throws ExecutionException, InterruptedException, TimeoutException {

        isNotNull(timeUnit, "timeUnit");
        long deadline = Clock.currentTimeMillis() + timeUnit.toMillis(timeout);

deadline should not be set to the current time (in ms) plus the timeout as it would be a huge number (currently set to 1,468,533,720,000) and the handling of TimeoutException only decreases it a small amount at the time

            long localTimeoutMs = Math.min(MIN_WAIT_ON_FUTURE_TIMEOUT_MILLIS, deadline);
...
            } catch (TimeoutException t) {
                deadline -= localTimeoutMs;

IMO deadline should have been set to the timeout

        long deadline = timeUnit.toMillis(timeout);
@mdogan mdogan self-assigned this Jul 15, 2016
@mdogan mdogan added this to the 3.6.5 milestone Jul 15, 2016
@mmedenjak mmedenjak added the Source: Community PR or issue was opened by a community user label Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source: Community PR or issue was opened by a community user Team: Core Type: Defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants