Unacquire jobs when AsyncExecutor shutdown method is called

#1

Hello Flowable experts,

I have the following situation:
I have two versions of my application and when I update from one of the versions to the other, I need the Flowable processes which are running on the old version to continue working on the other without failing.
What I have done so far, is to call the shutdown on the AsyncExecutor and wait some time(30 mins) and then kill the JVM. After that the new version is started and the new async executor is started and the processes are now working on the new version of my application.
The problem here comes, when I have some incompatible database changes in my application, then when the application is started, the old one(which waits the jobs to finish) will fail due to the incompatible DB changes. I have found solution(theoretical) for this situation: when the old version of the application is stopped(the shutdown method of the AsyncExecutor is called), the jobs of the AsyncExecutor to be unacquired and then kill the JVM. After the new version of the application is started, the AsyncExecutor will take the jobs and re-execute them.

However, this approach is not very easy as the shutdown method of the AsyncExecutor is not unaqcuiring the jobs. So, my preposition here is to add the following check to the shutdown method:

if (unlockOwnedJobs) {
unlockOwnedJobs();
}

This check right now is performed when the AsyncExecutor is started but it is not helping me as my new AsyncExecutor has a unique lock owner, so this method will not help when the AsyncExecutor is starting.
My question is, do you see that as a good approach?

Thanks,
Encho

#2

Hello,

I have made example PR for the described situation above: https://github.com/flowable/flowable-engine/pull/1734

#3

Hello,

Any thoughts here?

Thanks,
Encho

#4

Hello @filiphr, @martin.grofcik, @joram,

Could you take a look at this situation?
My team and I need this feature :slight_smile:

Thanks a lot!
Best regards,
Encho