Re: Handling backend connection issues on Gremlin-Server start up


David Pitera <piter...@...>
 

> ) Is this normal behavior to have Gremlin-Server continue even though the selected backend cannot be contacted on start up?

I think so yes because the way a backend becomes connected to is that we iterate through each graph inside the server YAML's graphs {} object and try to instantiate it. That graph reference instantiation is what opens the connections to the appropriate backend as defined in each graphs .properties file. You could have multiple graphs defined, each talking to a different backend. If one fails, it seems to be expected to still be able to work with the others.

> is there a way for me to send a command to the Gremlin-Server so it will attempt a reconnection when I know Cassandra is up? 

If the connection wasn't configured properly at server start, then there is no graph reference instantiated on the JVM and thus nothing to do to act on that graph or try to make it reconnect to the backend. The notion of "being connected to the backend" if really nothing more than a successful graph instantiation. Should Cassandra go down after this has successfully happened, the individual gremlin script submissions you send would fail, but start to succeed automatically when the backend came back up.

To fix your issue You could 1) restart the server or 2) use the `JanusGraphFactory.open()` method to dynamically instantiate the graph or 3) dynamically instantiate the graph once this PR https://github.com/JanusGraph/janusgraph/pull/392 has been merged. (Of course you'll need to read the documentation in further detail to see how to do so).

I would do (1) until you can do (3) as (2) will not store the graph reference in a GraphManager, and thus your graph's gremlin script executions will not be auto-managed (i.e. committed or rolled back) for you).


On Monday, July 3, 2017 at 12:43:24 PM UTC-4, Carlos wrote:
So I'm using Cassandra as my backend and I've noticed that if I've accidentally started my services out of order, Gremlin-Server will still successfully start up, but complain about not being able to connect to Cassandra. Gremlin-Server will still listen for connections and proceed to accept them, however any requests that are traversals will only end up causing an error to be returned. 

a) Is this normal behavior to have Gremlin-Server continue even though the selected backend cannot be contacted on start up? 
b) If it's normal behavior, is there a way for me to send a command to the Gremlin-Server so it will attempt a reconnection when I know Cassandra is up? 

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.