-
-
Notifications
You must be signed in to change notification settings - Fork 94
Description
ArcadeDB 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?