Andrea
Andrea
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
Regarding the lambda still waiting for full timeout after connection error I am not very familiar with lambda retry/timeout logic but would it help to raise an error if a connection error is detected? something like:
try:
NeptuneConnectionManager.create_remote_connection(host, port)
except (client_exceptions.ClientConnectorError, OSError) as e:
raise RuntimeError(f"Connection to Neptune failed: {e}")
try:
NeptuneConnectionManager.create_remote_connection(host, port)
except (client_exceptions.ClientConnectorError, OSError) as e:
raise RuntimeError(f"Connection to Neptune failed: {e}")
Also can try configuring the lambda to reduce the number of reties or max event age
36 replies
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
Regarding the driver timeout config I think I was wrong about not being able to configure the connection timeout specifically - this kind of config might be possible:
timeout = ClientTimeout(
total=5, # Total timeout for the connection (connect + read)
connect=2, # Timeout for establishing the connection
read=5, # Timeout for waiting for data after the connection
)
return driver_remote_connection.DriverRemoteConnection(
pool_size=1,
url=base_url,
message_serializer=serializer.GraphSONSerializersV3d0(),
headers=aws_auth_request,
transport_factory=lambda: transport.AiohttpTransport(
timeout=timeout,
heartbeat=2,
call_from_event_loop=True,
),
)`
timeout = ClientTimeout(
total=5, # Total timeout for the connection (connect + read)
connect=2, # Timeout for establishing the connection
read=5, # Timeout for waiting for data after the connection
)
return driver_remote_connection.DriverRemoteConnection(
pool_size=1,
url=base_url,
message_serializer=serializer.GraphSONSerializersV3d0(),
headers=aws_auth_request,
transport_factory=lambda: transport.AiohttpTransport(
timeout=timeout,
heartbeat=2,
call_from_event_loop=True,
),
)`
36 replies
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
curious what your lambda code looks like? is it possible there is some retry mechanism happening to attempt to reconnect when a connection failure is detected? The documented python driver example has such a mechanism.
36 replies
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
From what I can tell I don't see a way to set this via DriverRemoteConnection and it would require a python driver code change
36 replies
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
Are you referring to manually customizing the aiohttp.ClientSession's timeout configuration ? Curious how you set this value? I see examples documented here
36 replies
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
It seems the java driver has a connection timeout setting but I do not see one for the python driver
36 replies
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
I'm not sure if the read_timeout would apply to connection timeout, which is what I believe you are looking for specifically
36 replies
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
Looking at the reference documentation for python driver configuration you could try to customize the transport_factory which has some timeout settings
36 replies
ATApache TinkerPop
Created by masterhugo on 2/10/2025 in #questions
Gremlin python trying to connect Neptune WS when is down
hello @masterhugo what version of the python driver are you using?
36 replies
ATApache TinkerPop
Created by cdegroc on 1/20/2025 in #questions
Hot reloading of SSL certificates in gremlin-server
If we don't want to use the library itself the author's solution could be used as inspiration for TinkerPop specific solution
7 replies
ATApache TinkerPop
Created by GojosEnsei on 1/12/2025 in #questions
I am not sure how to use mergeE and mergeV using gremlin_python
Glad you found a workaround. Could you share what worked for you?
5 replies
ATApache TinkerPop
Created by danielcraig23 on 1/21/2025 in #questions
Trying to load air-routes.graphml yields no such file or directory
If you obtained the air routes file from the same repository that you linked I noticed the file is called air-routes-latest.graphml not air-routes.graphml, could that be the problem?
12 replies
ATApache TinkerPop
Created by danielcraig23 on 1/21/2025 in #questions
Trying to load air-routes.graphml yields no such file or directory
Using master branch I was able to see the error you had when using an incorrect file path but then the console succeeded after I modified the file path to point to the file I downloaded from Kelvin's repository:
Connected to the target VM, address: '127.0.0.1:53213', transport: 'socket'

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.tinkergraph
plugin activated: tinkerpop.sugar
plugin activated: tinkerpop.credentials
plugin activated: tinkerpop.remote
plugin activated: tinkerpop.utilities
gremlin> conf = new BaseConfiguration()
conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
graph = TinkerGraph.open(conf)conf = new BaseConfiguration()
==>org.apache.commons.configuration2.BaseConfiguration@6f9e08d4
gremlin> conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
==>null
gremlin> graph = TinkerGraph.open(conf)

==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(graphml()).readGraph('/mydata/air-routes.graphml')
graph.io(graphml()).readGraph('/mydata/air-routes.graphml')
/mydata/air-routes.graphml (No such file or directory)
Type ':help' or ':h' for help.
Display stack trace? [yN]n
n

gremlin> graph.io(graphml()).readGraph('/Users/x/Downloads/air-routes-latest.graphml')
graph.io(graphml()).readGraph('/Users/x/Downloads/air-routes-latest.graphml')
==>null
gremlin> g=graph.traversal()
:set max-iteration 1000 g=graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:3749 edges:57645], standard]
gremlin> :set max-iteration 1000

gremlin> g.V()
g.V()
==>v[0]
==>v[1]
==>v[2]
==>v[3]
==>v[4]
==>v[5]
==>v[6]
==>v[7]
==>v[8]
==>v[9]
==>v[10]
Connected to the target VM, address: '127.0.0.1:53213', transport: 'socket'

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.tinkergraph
plugin activated: tinkerpop.sugar
plugin activated: tinkerpop.credentials
plugin activated: tinkerpop.remote
plugin activated: tinkerpop.utilities
gremlin> conf = new BaseConfiguration()
conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
graph = TinkerGraph.open(conf)conf = new BaseConfiguration()
==>org.apache.commons.configuration2.BaseConfiguration@6f9e08d4
gremlin> conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
==>null
gremlin> graph = TinkerGraph.open(conf)

==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(graphml()).readGraph('/mydata/air-routes.graphml')
graph.io(graphml()).readGraph('/mydata/air-routes.graphml')
/mydata/air-routes.graphml (No such file or directory)
Type ':help' or ':h' for help.
Display stack trace? [yN]n
n

gremlin> graph.io(graphml()).readGraph('/Users/x/Downloads/air-routes-latest.graphml')
graph.io(graphml()).readGraph('/Users/x/Downloads/air-routes-latest.graphml')
==>null
gremlin> g=graph.traversal()
:set max-iteration 1000 g=graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:3749 edges:57645], standard]
gremlin> :set max-iteration 1000

gremlin> g.V()
g.V()
==>v[0]
==>v[1]
==>v[2]
==>v[3]
==>v[4]
==>v[5]
==>v[6]
==>v[7]
==>v[8]
==>v[9]
==>v[10]
12 replies
ATApache TinkerPop
Created by cdegroc on 1/20/2025 in #questions
Hot reloading of SSL certificates in gremlin-server
It might be worth taking a look at this solution someone created which uses scheduled file based change detection https://github.com/Hakky54/java-tutorials/blob/main/instant-server-ssl-reloading-with-netty/netty-server/README.md
7 replies
ATApache TinkerPop
Created by danielcraig23 on 1/21/2025 in #questions
Trying to load air-routes.graphml yields no such file or directory
Can you try to use an absolute file path instead of relative?
12 replies
ATApache TinkerPop
Created by gdotv on 1/20/2025 in #questions
Neptune, Gremlin Java & Bindings
Since tinkerpop 4 is not yet released, will it be a problem for you that Neptune will not have yet adopted the TP4 gremlin parameterization?
25 replies
ATApache TinkerPop
Created by gdotv on 1/20/2025 in #questions
Neptune, Gremlin Java & Bindings
Hello @G.V() - Gremlin IDE (Arthur) is there a specific tinkerpop version you are looking to use? I am asking because tinkerpop 4.0 had some recent changes to introduce gremlin parameterization using GValues - see https://github.com/apache/tinkerpop/pull/2919
25 replies
ATApache TinkerPop
Created by GojosEnsei on 1/12/2025 in #questions
I am not sure how to use mergeE and mergeV using gremlin_python
Hello @GojosEnsei what is the intended behaviour you are looking for if the edge exists already but you do not want to set the updated value to true?
5 replies
ATApache TinkerPop
Created by Jonathan Fridja on 10/27/2024 in #questions
What's the significance of done: false ? (after calling .next())
Hello @Jonathan Fridja can you please provide an example of the queries you are running and what you expect the result to be? Looking at the commit you linked the done value is used to determine if the end of the traversal has been reached or not.
3 replies