AcquireJobsRunnableImpl not stopping

We are using Flowable 5.23.0 in a Tomcat 9 engine along with our webapp. As part of the Tomcat shutdown process, we are calling ProcessEngines.destroy() as we have seen documented. However, Tomcat is hanging a long time before it forcibly shuts itself down. We added a thread trace and found out that org.activiti.engine.impl.jobexecutor.AcquireJobsRunnableImpl is still running. Is there anything else we need to do to get AcquireJobsRunnableImpl to stop running?

Thanks,
Joe

Calling destroy will normally close the job executor (of which the AcquireJobsRunnableImpl is part), so what you’re seeing is strange. In case you’re running with for example Spring this won’t be necessary as the close would be called as normal bean shutdown and calling .destroy() isn’t needed even.

So, to understand what’s going on we’d need to know how you’re instantiating the ProcessEngine. Can you post your setup for that?

We use ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration(), call a bunch of sets, and finally call config.buildProcessEngine() to get our engine. However, I see that we don’t call ProcessEngines.registerProcessEngine(). I think that’s why ProcessEngines.destroy doesn’t clean our engine up. Can you confirm that’s the case? The API/documentation is very sparse and difficult to tell what the right thing to do is much of the time.

Thanks,
Joe