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

juanavelez opened this issue Jul 14, 2016 · 0 comments


None yet
2 participants
Copy link

commented Jul 14, 2016

    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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.