GeezerVison is showing github.com — websocket timeouts, ping/pong · Issue #1202 · ArcadeData/arcadedb
websocket timeouts, ping/pong #1202DescriptionArcadeDB Version:
23.6.1
OS and JDK Version:
Debian 11, jdk-17
Expected behavior
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.
After I peeked at arcadedb source code in server/src/main/java/com/arcadedb/server/http/ws (and its parent http stack), though iI am not very literate with java, I felt that the [websocket ping/pong] (https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#pings_and_pongs_the_heartbeat_of_websockets) and as the connection is based on standard http connection, it is probably timing out when there is no activity.
Steps to reproduce
`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? Activitytolgaulas commented on 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
./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.
So ws works fine on ping/pongs. lvca commented on Aug 17, 2023 @tolgaulas do you know why it disconnects after a while? tolgaulas commented on Aug 17, 2023
@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.
we will dig into it more with node-red lvca commented on Aug 17, 2023 tolgaulas commented on 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 commented on Aug 18, 2023
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|