-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 #4462 - Prevent jetty 10 WebSocket close deadlocks #4472
Issue #4462 - Prevent jetty 10 WebSocket close deadlocks #4472
Conversation
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…4462-WSCloseWithLockHeld
...ty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketRemoteEndpoint.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…4462-WSCloseWithLockHeld
Something is going on with this build / test. |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Last change breaks 8 test cases. |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
...vax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketSession.java
Outdated
Show resolved
Hide resolved
...vax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketSession.java
Outdated
Show resolved
Hide resolved
...ty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketRemoteEndpoint.java
Outdated
Show resolved
Hide resolved
...ty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketRemoteEndpoint.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/BlockingCallback.java
Outdated
Show resolved
Hide resolved
...cket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseTest.java
Show resolved
Hide resolved
...common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketBasicRemote.java
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/BlockingCallback.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
...common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketBasicRemote.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
I changed it so we no longer fail the callback with a ISE if a frame is sent and we are closed, now it is a |
jetty-util/src/main/java/org/eclipse/jetty/util/BlockingCallback.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/BlockingCallback.java
Outdated
Show resolved
Hide resolved
...common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketBasicRemote.java
Outdated
Show resolved
Hide resolved
...-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java
Show resolved
Hide resolved
.../src/test/java/org/eclipse/jetty/websocket/tests/server/CloseInOnCloseEndpointNewThread.java
Show resolved
Hide resolved
@lachlan-roberts I would like to see, if it's not there yet, a test that cements the behavior of core for closes: that for 2 concurrent closes, the loser gets an exception thrown. Similarly, I would like to see a test that proves that it's still possible to write from Would be great if you can test concurrency of |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@simone I introduced the extra tests you wanted and addressed the review points.
It is never possible to write from |
That is so wrong. |
...-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java
Show resolved
Hide resolved
.../src/test/java/org/eclipse/jetty/websocket/tests/server/CloseInOnCloseEndpointNewThread.java
Show resolved
Hide resolved
…4462-WSCloseWithLockHeld
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
jetty-util/src/main/java/org/eclipse/jetty/util/BlockingCallback.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/BlockingCallback.java
Outdated
Show resolved
Hide resolved
jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/FlushTest.java
Outdated
Show resolved
Hide resolved
jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/FlushTest.java
Outdated
Show resolved
Hide resolved
...socket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java
Show resolved
Hide resolved
...socket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
b.block(getBlockingTimeout(), TimeUnit.MILLISECONDS); | ||
} | ||
|
||
private long getBlockingTimeout() |
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'm wondering if we should repeat the pattern (mistake?) of HTTP here. With HTTP we have a separately configurable blocking timeout, that only if not set do we default to idleTimeout. This way we can handle (if need be) the timeouts for sending a huge frame that might take longer than the idle timeout, even though it is never actually idle.
However, in HTTP, we have deprecated the blocking timeout in favour of the data rate mechanisms.... Which we don't really have here (but are probably good ideas for @ extensions?), but it may still be good to have to turn off the blocking timeout if we have confidence in our callback mechanism.
@sbordet - thoughts? I'm only making this a comment as I don't think we should hold this PR up while we ponder this.
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 - still lots of questions about this, but I think we should merge and resolve in other PRs
Closes #4462