Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
InvocationFuture long running operations #6248
The invocation mechanism for blocking operations relies on a periodic timeout so that the operation gets retried. To prevent the calling thread (future.get thread) to wait indefnitely, it will periodically ask the isstillrunning service if the operation got lost.
To prevent a thread doing this check, the CONTINUE_WAIT is set on the future and the thread unsets it and skips the is still running. The problem is when there are multiple threads doing the future.get. One thread will be lucky and see the CONTINUE_WAIT. The other thread might by unlucky since the other thread has unset the CONTINUE_WAIT value and therefor this thread will continue with the is still running check. Since blocking operations always return false, this thread will conclude that the operation isn't running anymore and therefore it will throw an OperationTimeout.
Effectively it means that an InvocationFuture in Hazelcast can't be shared between multiple threads for blocking operations.