You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I prefer the alternative you provided, it makes the solution more generic since it can also be used for tasks that shouldn't be stopped by external code. The tasks needs to be aware of the "at least once" policy of Zeebe anyway to deal with idempotency and such, so making them responsible of correctly reacting to timeouts seams not to be such a stretch. Might be great however to add a very simple way for a task to check "have I timed out?".
We should probably also add a "Timeout" to pyzeebe.JobStatus enum.
From the documentation, it's not clear whether a timed out task that fail has any impact (it only says that a success is not relevant any more), so depending on that a special treatment by Pyzeebe of the TimeOutException will be needed or not (but I like the idea of an explicit exception in any case).
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 argumentcancel_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.
The text was updated successfully, but these errors were encountered: