You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue was that WebSocketUpgradeHandler was marked as invocationType==NON_BLOCKING.
As such, the NIO subsystem was invoking HttpConnection.onFillable() with mode PC (and therefore from the selector thread), which eventually ends up calling EndPoint.upgrade(), which eventually calls the "connect" event handler, in this case WebSocketProxy.ClientToProxy.onWebSocketConnect() that uses a blocking APIs, namely CompletableFuture.get().
With the selector thread blocked there, the proxy was connecting to the same server, and if the server had only 1 selector, it would now be deadlocked.
This test is easily reproducible using taskset -c 0 to run the JVM because then the JVM assumes that there is only 1 CPU (so the server allocates just one selector).
Unfortunately the fix is to make WebSocketUpgradeHandler.invocationType=BLOCKING, because the current semantic of the Jetty WebSocket APIs is that it is possible to call blocking APIs from within WebSocket event handler methods.
Signed-off-by: Simone Bordet <[email protected]>
The fix is to make WebSocketUpgradeHandler.invocationType=BLOCKING, because the current semantic of the Jetty WebSocket APIs is that it is possible to call blocking APIs from within WebSocket event handler methods.
Signed-off-by: Simone Bordet <[email protected]>
Jetty version(s)
Jetty 12
Java version/vendor
(use: java -version)
17 & 19
OS type/version
Linux
Description
New flaky test showing up ...
The text was updated successfully, but these errors were encountered: