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
{{ message }}
Repository navigation
Quarkus vertx issues with Vite dev mode connection #15744
Discovered during Quarkus update: 2023-01-24 09:15:41,523 WARN [io.ver.cor.imp.BlockedThreadChecker] (vertx-blocked-thread-checker) Thread Thread[vert.x-eventloop-thread-3,5,main] has been blocked for 3895 ms, time limit is 2000 ms: io.vertx.core.VertxException: Thread blocked
Quarkus build works using java.net.preferIPv4Stack=true
On development mode connecting to dev server is not possible while using IPv6.
changed the title [-]ViteWebsocketConnection is listening on 127.0.0.1 - fails on IPv6[/-][+]ViteWebsocketConnection is trying to connect to 127.0.0.1 - failing on IPv6[/+]on Jan 24, 2023
changed the title [-]ViteWebsocketConnection is trying to connect to 127.0.0.1 - failing on IPv6[/-][+]Quarkus vertx issues with Vite dev mode connection[/+]on Jan 24, 2023
Broader stacktrace: 2023-01-24 11:55:02,088 WARN [io.ver.cor.imp.BlockedThreadChecker] (vertx-blocked-thread-checker) Thread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 604084 ms, time limit is 2000 ms: io.vertx.core.VertxException: Thread blocked at java.base@17.0.2/jdk.internal.misc.Unsafe.park(Native Method) at java.base@17.0.2/java.util.concurrent.locks.LockSupport.park(LockSupport.java:211) at java.base@17.0.2/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1864) at java.base@17.0.2/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3463) at java.base@17.0.2/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3434) at java.base@17.0.2/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1898) at java.base@17.0.2/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2072) at com.vaadin.base.devserver.viteproxy.ViteWebsocketConnection.<init>(ViteWebsocketConnection.java:73) <---- HERE at com.vaadin.base.devserver.viteproxy.ViteWebsocketProxy.<init>(ViteWebsocketProxy.java:55) at com.vaadin.base.devserver.viteproxy.ViteWebsocketEndpoint.onOpen(ViteWebsocketEndpoint.java:95) at io.undertow.websockets.EndpointSessionHandler.connected(EndpointSessionHandler.java:119)
It seems like a deadlock in the onMessage callback provided by ViteWebsocketProxy to ViteWebsocketConnection when there are many concurrent clients, such as in Quarkus tests
The following one blocks on sendText
browserSession.getBasicRemote().sendText(msg);
getLogger().debug("Message sent to browser: " + msg);
Refactoring it with asynchronous call seems to work and Quarkus test pass
browserSession.getAsyncRemote().sendText(msg, result -> {
getLogger().debug("Message sent to browser: " + msg);
});
Just to clarify, the deadlock happens on Undertow stack
The problem with IPv6 is probably because the development mode integration tests modules set -Dvaadin.devmode.vite.options=--host.
This configuration is not needed anymore, not that we proxy the Vite websocket
Activity
[-]ViteWebsocketConnection is listening on 127.0.0.1 - fails on IPv6[/-][+]ViteWebsocketConnection is trying to connect to 127.0.0.1 - failing on IPv6[/+][-]ViteWebsocketConnection is trying to connect to 127.0.0.1 - failing on IPv6[/-][+]Quarkus vertx issues with Vite dev mode connection[/+]Artur- commentedon Jan 24, 2023
Is IPv4 not available? Vite is configured to bind to 127.0.0.1
but based on the logs it seems like it does not bind to that but to IPv6?
Artur- commentedon Jan 24, 2023
It would probably be possible to parse the
from the Vite output and always use the address from there, then it would work no matter how it is bound
MarcinVaadin commentedon Jan 24, 2023
Broader stacktrace:
2023-01-24 11:55:02,088 WARN [io.ver.cor.imp.BlockedThreadChecker] (vertx-blocked-thread-checker) Thread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 604084 ms, time limit is 2000 ms: io.vertx.core.VertxException: Thread blocked at java.base@17.0.2/jdk.internal.misc.Unsafe.park(Native Method) at java.base@17.0.2/java.util.concurrent.locks.LockSupport.park(LockSupport.java:211) at java.base@17.0.2/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1864) at java.base@17.0.2/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3463) at java.base@17.0.2/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3434) at java.base@17.0.2/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1898) at java.base@17.0.2/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2072) at com.vaadin.base.devserver.viteproxy.ViteWebsocketConnection.<init>(ViteWebsocketConnection.java:73) <---- HERE at com.vaadin.base.devserver.viteproxy.ViteWebsocketProxy.<init>(ViteWebsocketProxy.java:55) at com.vaadin.base.devserver.viteproxy.ViteWebsocketEndpoint.onOpen(ViteWebsocketEndpoint.java:95) at io.undertow.websockets.EndpointSessionHandler.connected(EndpointSessionHandler.java:119)mcollovati commentedon Jan 24, 2023
It seems like a deadlock in the
onMessagecallback provided byViteWebsocketProxytoViteWebsocketConnectionwhen there are many concurrent clients, such as in Quarkus testsThe following one blocks on
sendTextRefactoring it with asynchronous call seems to work and Quarkus test pass
Just to clarify, the deadlock happens on Undertow stack
Artur- commentedon Jan 24, 2023
If that helps, I see no reason why not to change it
mcollovati commentedon Jan 25, 2023
The problem with IPv6 is probably because the development mode integration tests modules set
-Dvaadin.devmode.vite.options=--host.This configuration is not needed anymore, not that we proxy the Vite websocket
fix: forward messages asynchronously in Vite websocket proxy
fix: forward messages asynchronously in Vite websocket proxy (#15747)
vaadin-bot commentedon Feb 3, 2023
This ticket/PR has been released with Vaadin 24.0.0.alpha10 and is also targeting the upcoming stable 24.0.0 version.