-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Websocket client fails to connect when using native transport #41082
Comments
Weird issue. @cescoffier any idea what could be causing it? Furthermore, any chance you can test this @mkorman9 with the new websockets-next? |
Native transports are not supported in native. |
@geoand websockets-next seems to work fine -> https://github.com/mkorman9/quarkus-websockets-bug/tree/next so if it's a bug it's most likely somewhere in the "old" extension. @cescoffier I haven't tried a native build, my example is for JVM only. I guess the bot added the native-image tag by mistake. |
Thanks for checking |
So, when enabling native transport, it replaces the event loop implementation. Somewhere in the undertow extension, this possibility has not been anticipated. I need to check in details if we can remove the downcast. Websocket-next being on top of Vertx (without the undertow layer) does not have the problem, as Vertx is perfectly aware of the event loop implementation replacement. |
I can't reproduce it on Mac (switched to KQueue instead of Epoll). |
Sure thing |
The problem is that So the easy solution would be to change |
I can take a look at a proper fix later on today |
This is needed because WebsocketConnectionBuilder might be configured with a non NioEventLoopGroup Relates to: quarkusio/quarkus#41082
quarkusio/quarkus-http#155 is a workaround. A proper solution would mean passing the Channel class all around so it would have to break some public class and I am not sure if that is acceptable. |
The workaround proposed in quarkusio/quarkus-http#155 was merged. What are the next steps? |
Describe the bug
quarkus-websockets client is unable to connect to the server endpoint when running tests with
quarkus.vertx.prefer-native-transport
set totrue
.java.io.InterruptedIOException
is thrown by theconnectToServer
method and the suppressed exception isIssue is only visible when native transport is enabled, so
netty-transport-native-epoll
dependency with matching platform should be present on classpath.Expected behavior
Websockets client should be able to successfully connect to the server endpoint when running in tests
Actual behavior
connectToServer
fails withjava.io.InterruptedIOException
How to Reproduce?
./gradlew build
quarkus.vertx.prefer-native-transport
tofalse
inapplication.properties
fixes the issueGithub Action reproducing the issue jas been already prepared - https://github.com/mkorman9/quarkus-websockets-bug/actions/runs/9436762644/job/25991803842
Output of
uname -a
orver
Linux fv-az659-258 6.5.0-1021-azure #22~22.04.1-Ubuntu SMP Tue Apr 30 16:08:18 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "21.0.3" 2024-04-16 LTS OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)
Quarkus version or git rev
3.11.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 8.6 ------------------------------------------------------------ Build time: 2024-02-02 16:47:16 UTC Revision: d55c486870a0dc6f6278f53d21381396d0741c6e Kotlin: 1.9.20 Groovy: 3.0.17 Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023 JVM: 21.0.3 (Eclipse Adoptium 21.0.3+9-LTS) OS: Linux 6.5.0-1021-azure amd64
Additional information
No response
The text was updated successfully, but these errors were encountered: