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
acks: send sequence-0 ack for 0-window batches #479
Conversation
Ensures that at least one ACK is sent in reply to each window, including those with 0-length, by emitting an empty batch when we receive a 0-window frame and sending a sequence-0 ACK in reply when we process an empty batch. This enables upstream users of the protocol to (ab)use a 0-length window frame and an _ensured_ in-protocol response to validate that we are alive. Note: 0-sequence ACKs are already used as application-level keep-alives between when the `ConnectionHandler` receives bytes and when `BeatsHandler` finishes processing a batch, and therefore should already be handled gracefully by any existing clients.
@@ -5,6 +5,7 @@ env | |||
|
|||
set -ex | |||
|
|||
bundle exec rake test:java |
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.
review note: java unit tests were not being triggered as part of the build 🤦🏼
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, I tested locally with a modified lumberjack client. I could observe that with this patch the client immediately received an ack after sending an zero window frame, instead of waiting a long time for the ack from the idlestatehandler.
The script used, that takes code from the original lumberjack ruby client, can be found here: https://gist.github.com/jsvd/b86ea9d2f16a868c1460d4e12145a35f#file-beats_empty_writer-rb
…b.com> acks: send sequence-0 ack for 0-window batches (logstash-plugins#479) * acks: send sequence-0 ack for 0-window batches Ensures that at least one ACK is sent in reply to each window, including those with 0-length, by emitting an empty batch when we receive a 0-window frame and sending a sequence-0 ACK in reply when we process an empty batch. This enables upstream users of the protocol to (ab)use a 0-length window frame and an _ensured_ in-protocol response to validate that we are alive. Note: 0-sequence ACKs are already used as application-level keep-alives between when the `ConnectionHandler` receives bytes and when `BeatsHandler` finishes processing a batch, and therefore should already be handled gracefully by any existing clients.
Ensures that at least one ACK is sent in reply to each window, including those with 0-length, by emitting an empty batch when we receive a 0-window frame and sending a sequence-0 ACK in reply when we process an empty batch.
This enables upstream users of the protocol to (ab)use a 0-length window frame and an ensured in-protocol response to validate that we are alive.
Note: 0-sequence ACKs are already used as application-level keep-alives between when the
ConnectionHandler
receives bytes and whenBeatsHandler
finishes processing a batch, and therefore should already be handled gracefully by any existing clients.Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/