-
Notifications
You must be signed in to change notification settings - Fork 81
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
Switch from push mode to pull #485
base: main
Are you sure you want to change the base?
Switch from push mode to pull #485
Conversation
@@ -134,6 +134,7 @@ public void initChannel(SocketChannel socket){ | |||
new IdleStateHandler(localClientInactivityTimeoutSeconds, IDLESTATE_WRITER_IDLE_TIME_SECONDS, localClientInactivityTimeoutSeconds)); | |||
pipeline.addLast(BEATS_ACKER, new AckEncoder()); | |||
pipeline.addLast(CONNECTION_HANDLER, new ConnectionHandler()); | |||
pipeline.addLast(new FlowLimiterHandler()); |
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.
Do we have a reason why this is placed in this location of the pipeline? would it make sense to be first instead? Or right after the ssl handler?
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.
Moved in the same position it was from the originating PR #475, but your point is correct. It should be the first handler in the Netty pipeline
Release notes
To control spikes of memory usage, the incoming message reads switched from push mode to pull, so that the plugin has control on rate of ingestion and it's not the determined by the clients.
What does this PR do?
Changes the way the plugin pulls data and handle incoming connections to avoid many clients pushing more data than what it can handle.
Switches to pull read instead of push read. Instead to respond to every buffer that a connection present, it's the plugin that actively grab the byte buffer to process.
This work is based on the existing #410 #475.
Why is it important/What is the impact to the user?
Provides a counter measure to avoid that clients decide on the memory of the local process, pushing more and more data also if the process can't cope with the flow rate of allocations.
Checklist
Author's Checklist