Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2497

Test for DistributedExecutionCompletionService hangs, if instantiation is done by passing queue

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.2.0.Final
    • 5.2.0.Final
    • Clustered Executor
    • None

      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()).

              vblagoje Vladimir Blagojevic (Inactive)
              amanukya@redhat.com Anna Manukyan
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: