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
Issue #4824 - add configuration on RemoteEndpoint for maxOutgoingFrames #5059
Issue #4824 - add configuration on RemoteEndpoint for maxOutgoingFrames #5059
Conversation
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Maybe it would be better if instead we monitor how many frames are queued at a lower level and if this is exceeded we simply just fail the entire connection. |
@lachlan-roberts i think this PR needs a refresh / merge from |
…24-WSmaxOutgoingFrames
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 add a test that shows that maxOutgoingFrames
is respected.
callback = from(callback, numOutgoingFrames::decrementAndGet); | ||
if (outgoingFrames > maxNumOutgoingFrames) | ||
{ | ||
callback.writeFailed(new IOException("Exceeded max outgoing frames: " + outgoingFrames + ">" + maxNumOutgoingFrames)); |
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 change the exception from IOException
to WritePendingException
.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
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 - just improve the javadocs.
jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/RemoteEndpoint.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…24-WSmaxOutgoingFrames
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Attempt to address issue #4824 at the Jetty WebSocket API level.
If there are more than
maxOutgoingFrames
waiting to send, any additional sends will fail immediately instead of continuing to queue up in the flusher. The callback will be failed immediately but it will not fail the entire ws connection.This method is called
maxOutgoingFrames
but its not really as the implementation could later on decide to fragment each send from theWebSocketRemoteEndpoint
into multiple frames.