Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9342

disposeRuntimeEngine shouldn't throw exception if already closed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 7.44.0.Final
    • 7.43.0.Final
    • Runtime Engine
    • None
    • NEW
    • NEW

    Description

      There is a race condition in this test:

      • org.jbpm.test.functional.timer.GlobalQuartzDBTimerServiceTest.testQuartzJobDeletionOnManagerCloseWithTimerStart[2]

       
      2020-09-11 03:26:25,064 [TestScheduler_Worker-3] INFO Job default-per-pinstance.default-per-pinstance-StartProcess-Minimal-StartProcess-1 threw a JobExecutionException: org.quartz.JobExecutionException: Exception when executing scheduled job at

      org.jbpm.process.core.timer.impl.QuartzSchedulerService$QuartzJob.execute(QuartzSchedulerService.java:358) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at

      org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Caused by: java.lang.IllegalStateException: Runtime manager default-per-pinstance is already closed at

      org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager.disposeRuntimeEngine(PerProcessInstanceRuntimeManager.java:222) at

      org.jbpm.process.core.timer.impl.GlobalTimerService$DisposableCommandService.dispose(GlobalTimerService.java:381) at

      org.jbpm.persistence.timer.GlobalJpaTimerJobInstance.call(GlobalJpaTimerJobInstance.java:95) at

      org.jbpm.persistence.timer.GlobalJpaTimerJobInstance.call(GlobalJpaTimerJobInstance.java:48) at

      org.jbpm.process.core.timer.impl.QuartzSchedulerService$QuartzJob.execute(QuartzSchedulerService.java:339)

       

      If the runtime is disposed externally (as forced in the test)

      manager.disposeRuntimeEngine(runtime);

      at the same time that the timer tries to dispose it after the call method, the thrown IllegalStateException (because isClosed) makes if fail. 

      Attachments

        Activity

          People

            gmunozfe@redhat.com Gonzalo Muñoz Fernández
            gmunozfe@redhat.com Gonzalo Muñoz Fernández
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: