Task Retries Before Command Can Finish

Hello. I’ve devised a BPMN with 2 tasks. I’m using go to implement my client.

The first task consists of a series of bash command line operations, one of which takes at least 5 minutes (or potentially hours) to complete. However, before the command line operation can finish, the job handler (?) retries the task.

To keep it simple for the sake of demonstrating my concern, I am running

time.Sleep(10 * time.Minute)

and printing to STDOUT some log statements to track the timing.

$ go run timer2.go 
Starting MAIN

2019/07/29 13:25:10 Running TASK 1 for 2251799815734269
2019/07/29 13:25:10 [TEN MINUTE TIMER]: start
2019/07/29 13:30:13 Running TASK 1 for 2251799815734269
2019/07/29 13:30:13 [TEN MINUTE TIMER]: start
2019/07/29 13:35:10 [TEN MINUTE TIMER]: finish

2019/07/29 13:35:10 Complete job 2251799815734269 of type TASK 1

After about 5 minutes, the job seems to RETRY, as demonstrated by the log output with Running TASK 1 appearing a second time for the same job key, 5 minutes 3 seconds later.

Ultimately I would like to be able to run the client such that the job will wait until the task finishes. The actual command is to run 3rd party software to resize my cluster, which is why it can potentially take 5 minutes to a couple of hours to finish.

Is there anything in Zeebe that I can configure to make it wait? Or is my BPMN design all wrong? The current design is start->Task1->Task2->finish. The BPMN is new for me as of this year, so my experience with it limited to the experimenting I’ve been doing. Or perhaps it’s my lack of sophistication with go that hinders me! I started learning it only this year as well…

Thank you,

Hi @kwalker17!

By default, the job is acquired exclusively by the worker for 5 minutes. After this time, a worker can get the job again. As you saw in the outputs. Please have a look at the documentation for details: https://docs.zeebe.io/basics/job-workers.html

You can set the timeout when creating the job worker using the parameter Timeout(...).

Does this help you?

Best regards,

1 Like

Hello @philipp.ossler and thank you very much for explaining the default for the timeout and how to configure it. I changed the timeout as you suggested, and now I’m seeing the desired outcome. :smiley:


1 Like