quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.78k stars 2.68k forks source link

Max frame length of 65536 has been exceeded - Quarkus 3 #43381

Closed dometec closed 1 month ago

dometec commented 1 month ago

Describe the bug

WebSocket Server ignores Max Frame Size after upgrade from Quarkus 1.x to 3.14.4. In application.properties I set:

quarkus.websocket.max-frame-size=2097152

and get the exception:


2024-09-18 18:45:18,450 INFO  [com.vim.ngv.wss.TunnelWSS] (executor-thread-3) WebSocket tunnel error, session: lUIS0BLIvL7sX4SNrHaQrjlQCd3ld1B5W_yJT2FQ, error: Max frame length of 65536 has been exceeded..: io.netty.handler.codec.http.websocketx.CorruptedWebSocketFrameException: Max frame length of 65536 has been exceeded.
        at io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.protocolViolation(WebSocket08FrameDecoder.java:427)
        at io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder.decode(WebSocket08FrameDecoder.java:288)
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)
...

Expected behavior

No exception, or a message with my max frame size setting in "Max frame length of 65536 has been exceeded".

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

Linux localhost.localdomain 6.4.4-100.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 19 17:06:05 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "21.0.1" 2023-10-17 LTS

Quarkus version or git rev

3.14.4

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6

Additional information

I think this method miss to take the quarkus.websocket.* configuration...

https://github.com/quarkusio/quarkus/blob/1c8464b3ff87a75857bc1a8a9f0e8a72db584d58/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java#L1009-L1025

geoand commented 1 month ago

Thanks for reporting.

Going forward, all our efforts around WebSockets are focused on WebSockets Next. If you could try and see if the problem exists with that stack, it would be great.

cc @mkouba

mkouba commented 1 month ago

Hm, the quarkus.websocket.max-frame-size is a WebSocket client config property so I'm not really sure it ever worked on the server.

The corresponding configuration properties in WS Next are quarkus.websockets-next.server.max-message-size and quarkus.websockets-next.client.max-message-size.

dometec commented 1 month ago

@geoand ok I'll try. @mkouba not in Quarkus 1.x see https://github.com/quarkusio/quarkus/pull/7861/files#top

mkouba commented 1 month ago

@geoand ok I'll try. @mkouba not in Quarkus 1.x see https://github.com/quarkusio/quarkus/pull/7861/files#top

Interesting, it was removed (maybe unintentionally) in the "split" PR https://github.com/quarkusio/quarkus/pull/7861.

In any case, the development of the original WS extension is discontinued. We're looking forward to your feedback about WS next! ;-)

dometec commented 1 month ago

@geoand , I can't try websocket-next right now due to #43434. @mkouba submit a PR, I understand that the extension is discontinued, but until the new is in the experimental phase, I would like to fix the problem found.

Thanks!