Skip to content
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

Add support to -LEAVING error in GETJOB and other commands #28

Open
mariano opened this issue Mar 7, 2016 · 2 comments
Open

Add support to -LEAVING error in GETJOB and other commands #28

mariano opened this issue Mar 7, 2016 · 2 comments

Comments

@mariano
Copy link
Owner

mariano commented Mar 7, 2016

The GETJOB command, or other commands, may return a -LEAVING error instead of blocking. This error should be considered by the client library as a request to connect to a different node, since the node it is connected to is not able to serve the request since it is leaving the cluster. Nodes in this state have a very high priority number published via HELLO, so will be unlikely to be picked at the next connection attempt. See #25 regarding the latter

@Revisor
Copy link

Revisor commented Mar 7, 2016

I think this should be a responsibility of the Manager, and I would do it like this:

  1. Execute a command
  2. If any command returns the -LEAVING error, switch to a better node (switchNodeIfNeeded())
  3. Execute the command again, on the new node
  4. If the command returns the -LEAVING error, switch to a better node...

Until

  • we connect to a non-leaving node. In that case continue program execution
  • or we run out of nodes to connect to (switchNodeIfNeeded() throws a ConnectionException). In that case we have no other solution than to give up.

@mariano
Copy link
Owner Author

mariano commented Mar 7, 2016

Totally +1

On Monday, 7 March 2016, Revisor notifications@github.com wrote:

I think this should be a responsibility of the Manager, and I would do it
like this:

  1. Execute a command
  2. If any command returns the -LEAVING error, switch to a better node (
    switchNodeIfNeeded())
  3. Execute the command again, on the new node
  4. If the command returns the -LEAVING error, switch to a better
    node...

Until

  • we connect to a non-leaving node. In that case continue program
    execution
  • or we run out of nodes to connect to (switchNodeIfNeeded() throws a
    ConnectionException). In that case we have no other solution than to
    give up.


Reply to this email directly or view it on GitHub
#28 (comment).

@mariano mariano mentioned this issue Mar 7, 2017
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants