-
Notifications
You must be signed in to change notification settings - Fork 2k
Fixes to ConnectionLimit for use with WebSocket #13350
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
Fixes to ConnectionLimit for use with WebSocket #13350
Conversation
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
...-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketConnectionLimitTest.java
Outdated
Show resolved
Hide resolved
...-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketConnectionLimitTest.java
Outdated
Show resolved
Hide resolved
...jetty-tests/src/test/java/org/eclipse/jetty/ee10/websocket/tests/WebSocketOverHTTP2Test.java
Outdated
Show resolved
Hide resolved
...jetty-tests/src/test/java/org/eclipse/jetty/ee10/websocket/tests/WebSocketOverHTTP2Test.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
@Override | ||
public void onClosed(Connection connection) | ||
public void onClosed(SelectableChannel channel) |
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.
I was expecting this class to change to having two limits:
- Channel limit: onAccepting, onAccepted - > onClosed(SelectableChannel)
- Connection limit: onOpened(Connection) -> onClosed(Connection)
At the very least, the javadoc needs to be changed to explain that it is Channels that are being limited, not connections. If we leave it as just that, then perhaps the class name needs to be changed as well?
If the class limits both, then its name can stay the same, but more javadoc is needed.
Alternately, we have both ChannelLimit and ConnectionLimit listeners?
From conversation on weekly call... Deprecate |
Create another class to limit virtual connections (channels)... Maybe in a different PR |
I'm working on this. |
* Deprecated ConnectionLimit and associated Jetty module, and removed their usages in favor of EndPointLimit. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
…nLimit in a test. Signed-off-by: Simone Bordet <simone.bordet@gmail.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
Issue #13324
Change
ConnectionLimit
class to operate exclusively on TCP connections by adding aonClosed
notification to theAcceptListener
class.This will make it work with
WebSocket
where theHttpConnection
is closed and replaced with aWebSocketConnection
.When upgrading to WebSocket over HTTP/2 the
ConnectionLimit
will only apply to the singleHTTP2Connection
, and not to the multipleWebSocketConnection
s which can be created over streams on this connection.