-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Is your feature request related to a problem? Please describe.
If a task takes longer than 10 seconds to complete (by default, can be changed), The Zeebe broker will mark the task as timed out. However, the task may continue to progress on the worker. In this case, as the broker will allow other workers to start the task, it will lead to the task being processed twice.
To prevent this, having a way to cancel the task (e.g. with SIGINT), would prevent the task from being worked on by multiple instances.
Describe the solution you'd like
ZeebeWorker could get an argument cancel_on_timeout that means that the task will be cancelled if it runs longer than the timeout allows.
Describe alternatives you've considered
The user could also implement such a functionality within the task. However, it's not clear what should happen in case it times out, as failing the task (letting an exception bubble up) would mark the task as failed on the broker. Maybe the fact that the worker should allow the task to time out (i.e. not send anything back to the broker) could be indicated with a TimeOutException being raised in the user's code.