How to handle oban workers gracefully exit and how to make the oban queues global when say the phoneix application is deployed on multiple nodes?

I have a phoenix app using Oban for some background processing. How do I gracefully handle Oban worker exit.
Also, how to make Oban queues global?

This is built in, from the README:

  • Queue Draining — Queue shutdown is delayed so that slow jobs can finish executing before shutdown. When shutdown starts queues are paused and stop executing new jobs. Any jobs left running after the shutdown grace period may be rescued later.

I’m not sure what you mean by this. It is global by default, all connected nodes running Oban will execute jobs (if they are running the right queues). The queue limit isn’t global, though. If you set a queue limit of 1 and run 3 nodes it can run up to three jobs simultaneously, though only one on each node.


Hi Sorry for delayed response. I think queue draining should work for me. As for second point I meant to achieve global rate limit.

Good to hear that :+1:

There isn’t any global queue limit or global rate limiting built in. It is on the roadmap for Pro, but not available yet.

1 Like