GREMLIN driver connection issue (Npetune)

69 views
Skip to first unread message

Kashifa Khursheed

unread,
Apr 27, 2023, 7:19:09 PM4/27/23
to Gremlin-users
So, we have used gremlin driver to connect and query to Neptune instance in our application. And, this has been currently deployed to DEV instance, but we're facing issues with connectivity every now and then. This has been a recurring problem, and this is an issue with Gremlin driver for sure.

The recurring issue or error message encountered is:

Request Failed: Connection was closed by server.

Please have a look at the earliest or at least let us know of any fix for this bug.

Stephen Akaeze

unread,
Apr 30, 2023, 9:51:37 AM4/30/23
to Gremlin-users
My best guess is that AWS Neptune disconnects idle websockets after about 20mins. See the following link: https://docs.aws.amazon.com/neptune/latest/userguide/best-practices-gremlin-java-close-connections.html

Check the following
- Queries are well balanced across all existing websocket connections.
- If you are using IAM authentication, ensure your V4 signing for the connections are done correctly.
- Add retry logic/cleanup logic for your web socket connection pool.

Hope that helps. 

Kashifa Khursheed

unread,
May 2, 2023, 1:03:40 AM5/2/23
to gremli...@googlegroups.com
Sure, but I tried adding a back-off strategy for 5 max retries and it is still showing the same "Connection was closed by server" error after re-trying for 5 times. So, I believe this is happening because exhaustible number of connections are being opened and not closed appropriately. I wanted to know how to implement a connection pool here, so that the connection is returned back to pool when the function (sub-graph query) has run, and pick up an active connection from the pool when the function is starting to execute.

Regards.

--
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/cfXNiDLn9-g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/c006eab5-b26f-4947-b2ea-b56b3c97f029n%40googlegroups.com.

Stephen Mallette

unread,
May 2, 2023, 6:45:54 AM5/2/23
to gremli...@googlegroups.com
what version of neptune is it and what version of the java driver are you using to connect to it?

You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/CAJUWJT8CNAmFA%2B0kfYFcHSur_PCCoZObBOnkjUmx2Vy2Kb_MWw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages