Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceUnavailableException after some idle #425

Open
andrey-kastryukhin opened this issue Oct 12, 2021 · 1 comment
Open

ServiceUnavailableException after some idle #425

andrey-kastryukhin opened this issue Oct 12, 2021 · 1 comment

Comments

@andrey-kastryukhin
Copy link
Contributor

Hi Charlotte,

Once we have switched to Bolt client, we are struggling with a very specific issue which can be rerpoduced in our real project (in other words, we didn't manage to create a sample project that repeats the issue).
The preliminary steps are like this:

  1. Open some known page. This page queries Neo4j. Then several AJAX calls happen and they again query Neo4j.
  2. Wait for 5min
  3. Try to open any other page

In result we get the following exception:

Neo4j.Driver.ServiceUnavailableException: Failed after retried for 2 times in 30000 ms. Make sure that your database is online and retry again. ---> System.AggregateException: One or more errors occurred. ---> Neo4j.Driver.ServiceUnavailableException: Connection with the server breaks due to IOException: Unable to read data from the transport connection

We have the entire stack trace to provide, if you are interested.
Finally, next request to any page "restores" something under the hood, and everything starts working as usual.
We have looked over the server code that renders the first step's page and all subsequent AJAX calls, but we didn't find any smelly code. We suspect something wrong is done with async/await usage, but we use LindhartAnalyser and also our eyes are opened wide.

Did you see anything similar before? Could you please guide us to any direction?

@cskardon
Copy link
Member

Hey Andrey,

Are you able to try the BoltGraphClient(driver) constructor passing in an IDriver instance with the WithConnectionIdleTimeout set?

i.e. something like:

var driver = GraphDatabase.Driver("URI", 
	AuthTokens.Basic("neo4j", "neo"),
	config => config.WithConnectionIdleTimeout(TimeSpan.FromMinutes(10)));


var gc = new BoltGraphClient(driver);

And see if that helps?
If it is that, then we can look at making that configurable in the construction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants