Skip to content

Option to run periodic jobs without leader election? #747

Answered by bgentry
RobinLbt asked this question in Q&A
Discussion options

You must be logged in to vote

@RobinLbt from your post I’m not sure if you’re aware that River does not have any sort of host affinity or way to ensure that a job runs on any particular worker. Once it gets enqueued the job will get picked up by whichever worker happens to get to it first (on the queue in question). As such there is no way to guarantee that a set of jobs is spread evenly across all hosts, regardless of them being periodic or not.

The only way you could ensure this is if each host was working a queue that was unique for itself, and you enqueued the job in each of these queues separately. I’m not sure this would be worth it though, it feels like trying to force something that goes against the model of h…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RobinLbt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants