You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For metrics reporting this would be helpful to know, much in the same way that Puma's on_worker_boot hook will receive the index of the current worker.
If such a feature would be accepted I may be able to work on a PR for it this weekend.
The text was updated successfully, but these errors were encountered:
Oh, interesting! I've never used the index/key argument of Puma's on_worker_boot. What does it refer to exactly? What would it be here in Solid Queue? Thinking if it might make sense to pass itself 🤔
Looking at the source code for Puma, I'm oversimplifying but it effectively does this:
worker_count.timesdo# find lowest index that's not in use by# a currently running workerindex=next_worker_indexfork{spawn_worker(index)}end
So it'll try to reuse IDs whenever it has to refork.
In the case of SolidQueue, I'm thinking something similar?
A separate counter for each worker group and trying to re-use indexes if workers get restarted.
Solid Queue currently doesn't keep that kind of index per worker and workers don't know about their position within the list 🤔 Plus, the order is not really guaranteed, if they're registered and spawned in order, it's by chance. They do have a unique name that gets generated when they're registered, though. Maybe that could be used 🤔
For metrics reporting this would be helpful to know, much in the same way that Puma's
on_worker_boot
hook will receive the index of the current worker.If such a feature would be accepted I may be able to work on a PR for it this weekend.
The text was updated successfully, but these errors were encountered: