-
Notifications
You must be signed in to change notification settings - Fork 101
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
Dynamic discovery for zmq server and client #91
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The ZMQ client connector implements the Lazy Pirate pattern as laid out in the [ZMQ Guide - Chapter 4][lpp]. The essence is that we attempt to be more stable in our client requests as we assume the server may not be available for fulfilling responses. A connection will be created to the server and data sent with a timeout on the socket. If the socket becomes readable inside the timeout, we read the data and go on our way. If the socket does not become readable in the timeout, we will close and reopen the socket, send the data again, and again wait for a valid response or timeout. If we exceed the number of tries we do not attempt the connection anymore and we fail with a timeout message to the calling code. [lpp]: http://zguide.zeromq.org/php:chapter4#Client-side-Reliability-Lazy-Pirate-Pattern
By setting @running to true after the workers are started, it is possible that the worker could check the servers running status before it has been set, causing the worker to shutdown.
Conflicts: lib/protobuf/rpc/servers/zmq/server.rb
This gives the application time to load and make any needed configuration changes.
This is useful for apps running unicorn. Call restart in the after_fork callback.
@localshred bump. |
Bump indeed. Gimme a bit to check this out. |
debug_say('Configuring traps') | ||
|
||
exit_signals = [:INT, :TERM] | ||
exit_signals << :QUIT unless defined?(JRUBY_VERSION) |
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.
👍 on only registering QUIT
outside of JRuby.
Now was that so hard? Bravo @devin-c 👏 |
localshred
added a commit
that referenced
this pull request
Jun 13, 2013
Dynamic discovery for zmq server and client
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is ready for some initial feedback. So far only the server side is implemented. I based this branch off of my instantiate_runner_and_server branch.