mosquito-cr / mosquito

A background task runner for crystal applications supporting periodic (CRON) and manually queued jobs
MIT License
227 stars 24 forks source link

Provide a way to detect and clean up jobs which were started but never finished #91

Open robacarp opened 2 years ago

robacarp commented 2 years ago

This happens when a long-running job is interrupted (ctrl-c style), or a job crashes so badly that mosquito itself crashes (a crystal runtime bug).

image

image

related to #21

robacarp commented 1 year ago

With the addition of metric check-ins in #118, the back-end has knowledge of the list of workers currently running. If the job run metadata is updated with the id of the worker when the job starts, later workers can easily check to see that worker has expired and emit a warning and reap the keys.