Closed gusbicalho closed 5 months ago
It would also be useful to have a guide on how to deal with changes to workers, maybe even a migration helper to remove them from the cron table.
A guide is a gread idea, because it can be tricky to handle cleanly.
A migration to remove them from the cron table probably wouldn't work though. Not all nodes have a worker available, and migrations are typically ran before the rest of the application has booted, so there's no reliable way to tell what's missing.
As of v1.4 you can use sync_mode: :automatic
to get automatic crontab syncing.
Environment
elixir --version
)Current Behavior
With Oban Pro 1.3.5: We had a DynamicCron using a worker module. At some point the worker module was deleted as we did not need it anymore. Nobody thought of deleting the DynamicCron job that used that worker, however everything kept working fine.
When we bumped Oban Pro to 1.4.7, all our DynamicCrons stopped running. Our logs show the following error, once a minute:
It looks like the Supervisor kept trying to restart the plugin, but every time it crashes on startup due to the missing worker module.
Deleting the Cron from the database solved the issue.
Expected Behavior
A single bad job should not break the entire cron system. The old behaviour from 1.3.5 was better; even better would be to log a warning and display in the Oban dashboard something about that broken Cron.
It would also be useful to have a guide on how to deal with changes to workers, maybe even a migration helper to remove them from the cron table.