Hi
We are seeing a recurring issue using V4 Bolt driver to connect to talk to V3.5.14 Community Edition database.
Under constant low load, about 10% of transactions fail with.
"Neo4j.Driver: Cannot access records on this result any more as the result has already been consumed or the query runner where the result is created has already been closed."
The exception is thrown by GetListOfRecordsAsync
Reverting to an earlier version of the Driver seems to remove this behavior.
I've also been able to recreate this connecting to a Desktop edition V3.5.9
Any advice would be greatly appreciated.
See below for code snippet.
Many thanks
S
public IDriver CreateDriver(string uri, IAuthToken authToken, Neo4jLoggingHelper log)
{
return GraphDatabase.Driver(uri, authToken,
o => o.WithMaxConnectionLifetime(TimeSpan.FromMinutes(30))
.WithMaxConnectionPoolSize(50)
.WithConnectionAcquisitionTimeout(TimeSpan.FromMinutes(2))
.WithLogger(log));
}
public async Task<object> ExecuteCypherQueryInNeo4JAsync(string query, IDictionary<string, object> statementParameters, Neo4jLoggingHelper log)
{
if (_neo4JDriver == null)
{
// _log4j = new DriverLogger(log);
log.Info("Making initial bolt connection");
_neo4JDriver = CreateDriver(_neo4JUrl, _authToken, log);
}
Object result = null;
IAsyncSession session = _neo4JDriver.AsyncSession();
try
{
result = await session.ReadTransactionAsync(async tx =>
{
_resultCursor = await tx.RunAsync(query, statementParameters);
var records = await GetListOfRecordsAsync();
var summary = await _resultCursor.ConsumeAsync();
log.resultsReadyAfter = (long)summary.ResultAvailableAfter.TotalMilliseconds;
log.resultsConsumedAfter = (long)summary.ResultConsumedAfter.TotalMilliseconds;
log.resultsRetries = i;
return records;
});
}
catch (Exception e)
{
log.Warn(e,"Failed at attempt {i} of 5: ");
fail = true;
}
finally
{
await session.CloseAsync();
}