helidon
helidon copied to clipboard
Websocket not sending all messages
Environment Details
- Helidon Version: 2.3.1 onwards
- Helidon SE (not tested with Helidon MP)
- JDK version: Eclipse Adoptium 10.15 (but maybe all)
Problem Description
The websocket session.getAsyncRemote().sendObject() method & the synchronous variant are not sending all messages. Even a flush did not help. This problem exists since 2.3.1. We have rolled back to 2.3.0 and could not re-create the issue.
When sendObject() is called again, the previous messages, are sent and in turn the new messages are not delivered.
This issue is happening sporadically.
Steps to reproduce
session.getAsyncRemote().sendObject(requestId).get(2_000, TimeUnit.MILLISECONDS);
This code sporadically causes a TimeOutException on 2.3.1+. Once it has caused a TimeOutException, all subsequent calls will also cause a TimeOutException. However, in the course of each subsequent TimeOutException, one of the previous messages is transmitted.
We were able to perform the following test: The requestId is incremented with each call. So if the first call resulting in a TimeOutException was to send the requestId with the number 2, the next send call with requestId 3 will result in requestId 2 being sent, while requestId 3 will end up in a TimeOutException.
On older versions (2.3.0 and lower) our test cases never caused TimeOutExceptions.
Increasing the timeout value (2 or more seconds) has no impact. It seems that the Future always results in a TimeOutException. I have tested with up to one minute.
Since the version no of Tyrus is the same in both the helidon 3.2.0 and the helidon 3.2.1 version, something else must be causing this weird behaviour.
@BenjaminBuick
- What have you been using as a client in your testing to reproduce this problem?
- Does the problem occur when the machine is under heavy load?
- Have you tried this with a more recent Helidon version such as 2.5.X?
Could be related to PR #3108
@BenjaminBuick You should really try it out with the latest version of Helidon. There have been a significant number of changes in the Helidon internals as it related to sending/writing buffers. Perhaps the issue is still there, but looking at the changes between 2.3.0 and 2.3.1 isn't that relevant anymore.
@BenjaminBuick Ping
Hey @spericas! Thanks for getting back and sorry for the delay!
- We are using the javascript websocket client.
- No difference.
- We have tested it with 2.3.4 and the bug was present in versions 2.3.1 - 2.3.4.
I will test it with a more recent version - shall we keep the bug report open until then?
@BenjaminBuick Yes, let's leave it open until you test the latest version. As I said, issue may still be there, but we need to verify that before proceeding.
@BenjaminBuick Any update on this issue?
@BenjaminBuick Please re-open if necessary.