Feature request: auto reconnect
ebanisadr opened this issue · 1 comments
Environment
- Bolt.Sips version (mix deps):
bolt_sips 2.0.8 (Hex package) (mix)
Current behavior
If the neo4j server is restarted while my application is running then all future queries fail with a message like Port #Port<0.100> is closed
Expected behavior
If the connection is closed Bolt.Sips attempts to reopen the connection with the same credentials before returning an error.
Thank you for your feedback. I was contemplating the proposed feature, and I don't believe it is a responsibility this driver should bear. Even if we'll retry to reconnect, what happens to the service layers depending on it, and to your functions making calls to the db server and failing, during that process? Your app should handle the occasional unavailability of a persistence layer - this is just my opinion. And you can easily achieve the latter through your app design, i.e. monitoring the readiness of your resources, starting and restarting the drivers when the resources are not ready or failing, and so on. @keathley, who's advices I always respect and follow, has a very good series of articles written about this topic (but not limited to designing and configuring Elixir app). You could start with this one: Building Resilient Systems with Stacking Theory - HTH