Ensure the ping port is timed out after a reasonable amount of time #277
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.
Should a server's ping port get jammed, overwhelmed, or access a port that is not open, then the ping port check will block until the TCPSocket default timeout rescues the blocked request. Instead, we can wrap Socket to add a reasonable timeout to ping port checks. By default, the timeout is set to 5 seconds, but you can customize this by setting the
PB_RPC_PING_PORT_TIMEOUT
environment variable.There is probably some more work that can be done here, but I wanted this PR to be about solving this ping port problem before I make a few more changes, like using
PB_RPC_PING_PORT
inside of the newPing
class.cc @abrandoned @quixoten @mmmries @liveh2o @brianstien @localshred