Details
-
Bug
-
Resolution: Done
-
Major
-
5.2.0.Beta4
-
None
Description
Hi,
during writing tests for DistributedExecutionCompletionService, the following issue raised:
I'm creating DistributedExecutionCompletionService with constructor
protected DistributedExecutionCompletionService(DistributedExecutorService executor, BlockingQueue<NotifyingFuture<V>> completionQueue, QueueingListener listener)
the constructor is protected, and my test is located in the same package.
As a completionQueue I'm passing ArrayBlockingQueue, and as a listener I'm passing my created QueueingListener instance.
When I submit simple callable to the service which just should return 1, and then call take() method of the completion service, the suite hangs. I've added some log for finding out whether the task is executed and listener is notified, and yes - the listener is notified and the queue is filled with the completed future task. But the take() method hangs and doesn't return the value.
If I use poll() instead of take(), and poll() the completed task after waiting for some time, the returned value is null, although it is already in the completion queue.
The test reproducing the issue is:
https://github.com/andyuk1986/infinispan/blob/DIST_EXEC_TESTS/core/src/test/java/org/infinispan/distexec/DistributedExecutionCompletionTest.java (testBasicInvocationWithBlockingQueueAndListener()).