-
Notifications
You must be signed in to change notification settings - Fork 60
Resilient verk improvements #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If generate_node_id is true it will ensure that the set of nodes includes the local node_id and that the set of tracked queues includes the managed queue If generate_node_id is false then it will work as previously
This data will be tracked automatically by QueueManager
Verk.Node.register/3 is not necessary anymore. Verk.Node.expire_in/3 can be used instead as QueueManager adds the running node to the nodes key
2 similar comments
Updated algorithm:
How to use:
If it's not true it won't use this new code. It will basically work as before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Here are some changes I made from the original PR #159
QueueManager
maintainsverk_nodes
andverk:node:#{node_id}:queues
up-to-date. It avoids possible de-synchronization between Redis and local state of the Verk node. The main idea behind this changes is: "If any job is added to theinprogress
list, this node and this queue must be tracked so that other nodes can rescue their failure if it happens."QueueManager
will conditionally maintain these data structures ifgenerate_node_id
is true.Node.Manager
to not crash ifheartbeat
failed.