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
websocket connections should not expire until closed or websockets should respond pings with pongs to keep the connection open.
Actual behavior
I could not test it thoroughly but what I observed from various tools (i.e wsocat,nodejs), the subscription works but after sometime the announcements stop. In nodejs what we see the server closes connection.
`connect with ws for subscribe, insert into watched db, observe the announcement, wait for long time (10m?), and insert one more time, observe nothing published on websocket (wsocat reconnect the socket i presume, nodejs doesnot hence gives disconnected notification even before that.
<An SQL script to reproduce the problem or a JUnit test case will increase **A LOT** the chance to have a quick fix>
Can you pls shed some light on this? I know REST/JSON has some session-id passing feature (which expires on transcations).
if we periodically subscribe by sending commands, this connection remains open, but this sounds unwise as it may kill resources in the server, am I wrong?
I dug a little and i saw that the webserver extends a portion of the undertow's websocket default implementation which by default respond to pongs. And i confirm this by using this and sow that it responds the pong messages
./websocat "ws://user:pass@arcadedb:2480/ws" --ping-interval 1 --ping-timeout 2 --print-ping-rtts -E
RTT 0.082423 s
RTT 0.068529 s
RTT 0.069332 s
RTT 0.067708 s
RTT 0.069457 s
RTT 0.069364 s
RTT 0.075618 s
RTT 0.067169 s
Also, node-red's stock websocket had some issues in reporting/displaying the connection as disconnected while it actually was not.
@tolgaulas do you know why it disconnects after a while?
Actually it does not, we were testing it with node-red, it was node-red's mistake as displaying such. So it was a false-error. Despite its been claimed its fixed here, we're having similar problems with it.
@lvca also made an extensive test on ws timeouts, I can confirm that ws connections are kept alive for 6min, 60min, 600mins, 6000mins idle intervals and acted as behaved (responded to the open channel with actions_) at the end of the pauses all the time. Also peeped the source, i could not see any kind of session management in websocket related activities but only in transactional stuff at the moment, . So my initial report was false (may be due to unhealthy network environment ); ws is healthy, rock solid and per standards.
Activity
tolgaulas commentedon Aug 17, 2023
I dug a little and i saw that the webserver extends a portion of the undertow's websocket default implementation which by default respond to pongs. And i confirm this by using this and sow that it responds the pong messages
Also, node-red's stock websocket had some issues in reporting/displaying the connection as disconnected while it actually was not.
So ws works fine on ping/pongs.
lvca commentedon Aug 17, 2023
@tolgaulas do you know why it disconnects after a while?
tolgaulas commentedon Aug 17, 2023
Actually it does not, we were testing it with node-red, it was node-red's mistake as displaying such. So it was a false-error. Despite its been claimed its fixed here, we're having similar problems with it.
we will dig into it more with node-red
lvca commentedon Aug 17, 2023
Ok, thanks.
tolgaulas commentedon Aug 18, 2023
@lvca also made an extensive test on ws timeouts, I can confirm that ws connections are kept alive for 6min, 60min, 600mins, 6000mins idle intervals and acted as behaved (responded to the open channel with actions_) at the end of the pauses all the time. Also peeped the source, i could not see any kind of session management in websocket related activities but only in transactional stuff at the moment, . So my initial report was false (may be due to unhealthy network environment ); ws is healthy, rock solid and per standards.
lvca commentedon Aug 18, 2023
Great, thanks @tolgaulas for digging into this.
chore(deps): bump org.codehaus.mojo:versions-maven-plugin from 2.18.0…
chore(deps): bump org.codehaus.mojo:versions-maven-plugin from 2.18.0…