runabol / tork

A distributed workflow engine
https://tork.run
MIT License
599 stars 40 forks source link

Add task timeout #223

Closed ppcololo closed 1 year ago

ppcololo commented 1 year ago

From time to time some workers hang due to execution script.

Example: we have python scripts + playwright Firefox browser. Sometimes this Firefox hangs and task stops. In this state it could be long time before we identify that this is fail of script (and another worker already finish this task due to Queue timeout).

So we know average time of task execution and is it possible to add some value during Job creation that if task executing longer than X we can restart it?

runabol commented 1 year ago

Yea, that is supported. See: https://www.tork.run/rest-api

You can specify timeout value at the task level and a as default value at the job level.

ppcololo commented 1 year ago

What are the possible values? timeout: 10s|10m|10h|10d?

runabol commented 1 year ago

Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y".

Ref: https://pkg.go.dev/maze.io/x/duration#ParseDuration

ppcololo commented 1 year ago

Thanks a lot!