gearman / gearmand

http://gearman.org/
Other
741 stars 138 forks source link

How do I return a background job to the queue if it fails? #251

Closed alglyzin closed 5 years ago

alglyzin commented 5 years ago

If there is a task execution error, I want the task not to be removed from the queue. And started again.

p-alik commented 5 years ago

If there is a task execution error, I want the task not to be removed from the queue. And started again.

gearmand doesn't restart failed jobs. By non-background approach it is possible to provide worker's notifications to the client.

See WORK_FAIL, WORK_EXCEPTION in http://gearman.org/protocol/

alglyzin commented 5 years ago

Must do for background job.

It turns out that Geraman will not restart the work in any way? Even if the background work is not successful, will it still remove it from the queue ?!

p-alik commented 5 years ago

It turns out that Geraman will not restart the work in any way?

Indeed gearmand doesn't restart any jobs.

esabol commented 5 years ago

Does the --job-retries=NUMBER option not do this?

 -j, --job-retries=RETRIES  Number of attempts to run the job before the job
                           server removes it. This is helpful to ensure a bad
                           job does not crash all available workers. Default is
                           no limit.