I am using gremlin-driver to connect to cosmosDB. I am working with multiple graph instances simultaneously. I am storing the client objects in a cache, and using it to submit gremlin queries. How should I go about closing these on cache evict, when the maxTtl limit is hit? I am planning to call client.getCluster().close()
on cache evict, but not sure what happens to the existing queries in flight when the close is called. What is the best practice here?
Asked
Active
Viewed 146 times
1

Michael Scott
- 540
- 2
- 8
1 Answers
1
This is how we are solving the problem. We are adding the evicted clients to a secondary cache with that evicts after a predefined interval(30s). This is to give sufficient time for the pending transactions to complete. On the secondary evict, we close the client and cluster.

Michael Scott
- 540
- 2
- 8