AWS Neptune: Pong fails and close event not emitted

Hey guys, long time no see. We have an issue which occurred a few times in the last couple weeks and we've been investigating for a while; posting here in case the issue is maybe known. We are using the gremlin-aws-sigv4 in a NodeJS project. We occasionally do a ping to the server and wait for a Pong with a timeout of 3 seconds. If a pong times out, we decide that the connection is not doing well and close it. We do it by accessing the websocket and calling terminate() on it. Along the process, this begins the close() function to close the connection to the server, which then waits for the close event. However, it seems like the event is sometimes never actually emitted, which leaves the connection open for a long time. Either the connection is not being closed properly, or the connection is not emitting the event for some reason, leaving the connection open and is in memory forever. This causes a memory leak over time. Any ideas what we could do to handle those issues?
Solution:
Interesting approach. Our typical guidance is to not worry about whether or not the connection is live and assume it is always available. Then build in exception handling and reconnect logic for the condition when a query is sent to a closed connection. Neptune will close connections on the server side if they are idle for more than 20-25 minutes.
Jump to solution
3 Replies
Solution
triggan
triggan6mo ago
Interesting approach. Our typical guidance is to not worry about whether or not the connection is live and assume it is always available. Then build in exception handling and reconnect logic for the condition when a query is sent to a closed connection. Neptune will close connections on the server side if they are idle for more than 20-25 minutes.
Shush
Shush6mo ago
Hi, thanks for replying, so we eventually found a way to fix this, it has to do with how the library for neptune is set up, it has a ping interval of 1 second and a pong timeout of 2, and it seems to not close it properly when the pong times out. So we hacked the library and added code that terminates the websocket and then the client from within, and increased the ping interval to 6 and pong timeout to 3 (so the ping and pong intervals are always correctly pointed towards). Fixing those fixed the issue for good.
triggan
triggan6mo ago
Which "library for neptune" are you referring to?
Want results from more Discord servers?
Add your server
More Posts
Gremlin upsert on a vertex but preventing updates on a particular property on a vertex during upsertHi, Following is an upsert query on a vertex with label 'stvertex' and I am required to initialize aDoes graph notebook still work after changes to serializers?I am trying to use the graph-notebook project, my project previously worked. I updated Aerospike graImplementing Graph Filter for Sub-Graph Loading in Spark Cluster with JanusGraphHello, I'm currently utilizing JanusGraph 0.6.4 with Bigtable as the storage backend and encounteriTesting against AWS NeptuneHi, the app that I'm maintaining has a Neptune integration for which I've written some integration tJanusgraph vertex property with cardinality as SET typeHi, need a working example of how a property can be added to a vertex with cardinality as SET type aError: `Failed to authenticate`, when connection pool size is >1 for GremlinServer with ArcadeDBHi Friends, I am exploring and evaluating ArcadeDB. The DB is setup with GremlinServerPlugin to expoHow can I use the .io("filename.json").write() pattern to append to an existing graphson file?I have read about defining a custom GraphWriter using the builder, but wanted to ask first before spusing tinkerpop 3.6.x on a jdk 21 projectI'm using tinkerpop 3.6.5 to read/write over an AWS neptune graph database. Is there any issues usinIs the following use of next() allowed?The update does not seem to work in this case, even when `changes` is a non-empty object. No error iGremlin-go cannot bring out props when querying Vertex with Neptune```golang g := gremlingo.Traversal_().WithRemote(driverRemoteConnection) traversal := g.GetGraph