cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Job executioner removing the job record on server restart

satramalin
Champ in-the-making
Champ in-the-making
Hi,
My process has a polling service which has a system task and an user task. The user task has a timer for 3 minutes which routes back to the system task which reads mail.

The server hosting the web application had a restart when the job executioner had picked up the job from the jobs table (Now there are no jobs in the jobs table for the process). So when the server was up again, the process didn't continue as expected. I had to manually start the process again.

Can you please help me to address this issue? Thanks.
6 REPLIES 6

jbarrez
Star Contributor
Star Contributor
Im not sure I follow. If a job was picked up, and the server went down, the transaction is rolled back in the database, and it is set to the previous state.

So I'm not understanding it correctly, or is it more complex as that?

satramalin
Champ in-the-making
Champ in-the-making
Thanks for your response. The last wait state was a timer and the timer got fired which pushed the instance to the service task. The JVM now restarts when the execution is on the service task. If I am not wrong, the execution should now go to the last wait state which is the timer(timer is attached to the user task). This timer has already fired and there are no records in the jobs table. In this case, the instance gets stuck at the system task without moving forward. Attached is the .bpmn for your observation. Can you please help with a new design if this does not suit.

dmoturu
Champ in-the-making
Champ in-the-making
Hi Joram & other experts,

We have a scenario I think it is same as above.
In our BPD we have a start event –> Service Task1 –> User task (with 2 days due date) with a attached Timer event that fires after 5 mins–> And the flow from Timer goes back to Service Task 1again.

Goal is to make Service Task1 run in an end less loop.

This BPD is working fine and able to run the Service Task1 in endless loop as designed.

However, It is getting into hung state whenever JVM is restarting (due to any other reason)  while Service Task1 is in middle of execution.

Any idea why BPD instance is getting hung state instead of restarting from the Service Task1?

Addition info is we set both Asynchronus  and exclusive set to true for Service Task1.

jbarrez
Star Contributor
Star Contributor
@satramalin :you have async on the service task. The last stable state is the moment just before the service task. That is why you see what you see. The timer fires, and it commits right before the service task due to the async bit.

@dmoturu : What do you mean with endless loop? And endless Java loop? In that case, that's something I wouldn't do, as you are keeping your transaction open for a long time. Most databases dont like that.

dmoturu
Champ in-the-making
Champ in-the-making
Thanks Joram for response.

What I meant by endless loop is there is going to be only one process instance is active and running for ever and the flow of it comes back to the Service Task repeatedly at every 5 minutes.

User task (with its due date gets set to 2 days every time it is created) is a dummy and does nothing in this case as the timer fires at 5 minutes after its creation and closed by the Timer.

Timer flow goes back to the Service Task so that it gets executed repeatedly at every 5 mins.


jbarrez
Star Contributor
Star Contributor
ok, now i follow your explanation. But i can't quite say why the JVM is hanging. Also: how do you verify this? Isn't it the database that is waiting on someting?

The theory of Activiti and transactions is simple: server goes down -> transaction rollback