e8l
e8l
ATApache TinkerPop
Created by e8l on 9/27/2024 in #questions
[Bug?] gremlinpython is hanged up or not recovering connection after connection error has occurred
Hello, TinkerPop team. I am struggling to avoid problems after a connection error occur. And now, I suspect it might be led by something bug of gremlinpython... Are these bugs? Or just I use it wrongly? Please let me know. Best Regards, environments - wsl2 on Windows11 (Ubuntu) - Python 3.12.4 - gremlinpython 3.7.2 - TinkerPop server: JanusGraph 1.0.0 JanusGraph is launched by docker compose:
services:
janusgraph:
image: janusgraph/janusgraph:1.0.0
ports:
- '8182:8182'
services:
janusgraph:
image: janusgraph/janusgraph:1.0.0
ports:
- '8182:8182'
Case 1: Script is hanged up when all pooled connections are consumed? When I specify wrong url to simulate network error, gremlinpython might consume connections and do not return them into the pool. So, below script is hanged up after all pooled connections are consumed. Python Script: see case1.py The Output: see case1-output.txt The result is changed when I specify different value to pool_size argument. My expectation is that error messages are shown in 9 times and the script ends. Case 2: Manual transaction is never rolled back(closed) Same as case 1, manual transaction is never ended. So, I cannot recover the error. Python Script: see case2.py The Output: see case2-output.py My expectation is that this script is end after trying 9 times and all trials are failed. Case 3: Once a connection error occurred, pooled connections are broken After I stopped TinkerPop server(JanusGraph) temporary, some pooled connections are broken and will not be recovered. Python Script: see case3.py The Output: see case3-output.txt My expectation is that connections are refreshed if they are not available when get them from the pool.
9 replies