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

Problems with timeout in blocking calls #9250

pveentjer opened this issue Nov 14, 2016 · 1 comment


None yet
2 participants
Copy link

commented Nov 14, 2016

In case of retrying a BlockingOperation, the waitTimeout is made smaller so that
a timed blocking operation eventually times out.

However there are 2 bugs:

  • it can happen that a positive timeout, becomes negative due to subtraction. A negative
    timeout is considered to be an infinite timeout. So this can cause problems since the bound waiting transforms into an infinite wait.

  • it can happen that a blocking call doesn't wait as long as specified because instead of subtracting
    the elapsed time (good), the call timeout is subtracted (bad). This is a problem if the elapsed time is
    smaller than the call timeout. This can happen because the OperationParker periodically sweeps
    through all operations to expire them. This could happen 1 second after the operation
    get executed, but it will still get a 60 second (default timeout) being deducted from the
    remaining timeout. So it could be that you call lock.tryLock(60,seconds), but instead of waiting 60 seconds for the lock to come available, after 0 seconds the lock.tryLock could return false.


This comment has been minimized.

Copy link
Member Author

commented Nov 14, 2016

For more info see:


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.