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

Execution of concurrent batch jobs containg partitioned steps causes deadlock

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 1.2.0.Final
    • 1.1.0.Final
    • jberet-core
    • None

      I have a batch job containing a partitioned step. I need to start a dynamic number of instances of this job.
      Assuming a configured jbatch thread pool size of n, starting n job instances all at once causes all the instances to deadlock. This is because each job instance consumes 1 "main" thread of the thread pool to start the job. Once the partitioned step is started, there are no free threads available any more and all executions are waiting for completed partition threads in StepExecutionRunner:329.

      Possible solutions:

      • Obtain the coordinator (aka "main") thread from a separate thread pool which would ensure that at least 1 batch thread is available for partition execution (assuming the number of batch threads is greater than 0).
      • Before actually starting the execution of a job, check if the job contains partitioned steps and, if yes, reserve at least 2 threads from the pool.

              jperkins-rhn James Perkins
              moritz.becker@gmx.at Moritz Becker (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: