-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Schedule transport ping interval #10189
Conversation
if (lifecycle.stoppedOrClosed()) { | ||
return; | ||
} | ||
for (Map.Entry<DiscoveryNode, NodeChannels> entry : connectedNodes.entrySet()) { |
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.
can you assign the key and the value here before we use it? it's way easier to read
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.
sure
I left some comments |
@s1monw addressed your comments, ready for another round |
DiscoveryNode node = entry.getKey(); | ||
NodeChannels channels = entry.getValue(); | ||
// we only support the ping message format since 1.6 | ||
if (node.version().onOrAfter(Version.V_1_6_0)) { |
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.
please make sure you remove the conditional on master
left one comment LGTM otherwise |
Sometimes, when using transport client for example, through a load balancer, there is a need to send a scheduled ping message to keep each channel alive. Add support for `transport.ping_schedule`, which controls the schedule (-1 for disabled) at which a ping message will be sent. For transport client case, it gets enabled automatically since almost always this is the desired behavior. We use the same 6 bytes header format for the ping message, with ES header and -1 for data length for ping message, and simply continue to process the next messages once this is encountered. closes elastic#10189
Sometimes, when using transport client for example, through a load balancer, there is a need to send a scheduled ping message to keep each channel alive. Add support for `transport.ping_schedule`, which controls the schedule (-1 for disabled) at which a ping message will be sent. For transport client case, it gets enabled automatically since almost always this is the desired behavior. We use the same 6 bytes header format for the ping message, with ES header and -1 for data length for ping message, and simply continue to process the next messages once this is encountered. closes #10189
Sometimes, when using transport client for example, through a load balancer, there is a need to send a scheduled ping message to keep each channel alive.
Add support for
transport.ping_schedule
, which controls the schedule (-1 for disabled) at which a ping message will be sent. For transport client case, it gets enabled automatically since almost always this is the desired behavior.We use the same 6 bytes header format for the ping message, with ES header and -1 for data length for ping message, and simply continue to process the next messages once this is encountered.