Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-125

Split may cause deadlock

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.1.Beta
    • None
    • None
    • None
    • Hide

      An example of problematic situation: a state where I have X instances of a job which have arrived at my split and which have invoked latch.await() where X happens to be the number of threads I have made available to the batch runtime. All X jobs are waiting on each other to release a thread in order to continue and all are thus perpetually frozen.

      Show
      An example of problematic situation: a state where I have X instances of a job which have arrived at my split and which have invoked latch.await() where X happens to be the number of threads I have made available to the batch runtime. All X jobs are waiting on each other to release a thread in order to continue and all are thus perpetually frozen.

      Split may cause deadlock in such case where there are tons of jobs waiting to run that have split elements. if these jobs arrived to execution of split simultaneously, they may run out of number of threads that allowed to batch runtime. then parent thread will be frozen at invocation of latch.await() in SplitExecutionRunner#run() and child threads that submitted at CompositeExecutionRunner#runFlow() will never be started because there is no vacancy in the thread pool.

      It seems to that an another approach which is avoiding use of CountDownLatch is needed because it consumes a thread while waiting for completion of child flows. it would be something like, leave responsibility to child threads that checking whether all of execution of child steps are completed or not.

      An another possible option is that revert of timeout of latch.await(). it should be brought by an extra property like jberet.local-tx because timeout of split was JBeret specific.

      Original discussion in related issue: https://issues.jboss.org/browse/JBERET-54

              cfang@redhat.com Cheng Fang
              xkylex Kohei Nozaki (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: