Closed samgerene closed 4 years ago
Hi samgerene. I'll take a look and see if I can reproduce and debug the issue using the test repository you have supplied (very useful thank you!).
I've not had any success in reproducing this issue locally using your sample project. The code has successfully created the list when connecting to both a 4.1.1 desktop Neo4j db, and a docker image 4.0.0 Neo4j db. I'm currently looking into if the issue might be that you are creating the list directly from the cursor. Could you try changing that line to the following to see if it works:
var records = new List
To expand on my previous answer. The code snippet I gave is how the list is created internally in the extension method ToListAsync of the IResultCursor interface. In doing it explicitly in your code we will be able to see if it is successfully adding any records and how many.
Have you tried reverting the driver to 4.0.2? We are experiencing a similiar problem with large result sets... seems to go away when we drop back to the 4.0.2 version of the driver. Trying to figure out a repro scenario on a fake database.
To expand on my previous answer. The code snippet I gave is how the list is created internally in the extension method ToListAsync of the IResultCursor interface. In doing it explicitly in your code we will be able to see if it is successfully adding any records and how many.
Hi, In previous code i did the same thing and the issue was the same.
Have you tried reverting the driver to 4.0.2? We are experiencing a similiar problem with large result sets... seems to go away when we drop back to the 4.0.2 version of the driver. Trying to figure out a repro scenario on a fake database.
I will give that a try
I've not had any success in reproducing this issue locally using your sample project. The code has successfully created the list when connecting to both a 4.1.1 desktop Neo4j db, and a docker image 4.0.0 Neo4j db. I'm currently looking into if the issue might be that you are creating the list directly from the cursor. Could you try changing that line to the following to see if it works:
var records = new List(); while(await cursor.FetchAsync().ConfigureAwait(false)) { records.Add(cursor.Current); }
i see a difference in setup, i am using docker neo4j 4.1.1 and not 4.0.0, could that make a difference?
I'm not sure that it would, but I will be doing the test with 4.1.1 in docker this morning. Are you running a Linux container or a Windows container in docker? Could you also supply some timings from the log file of some runs with the sample project, just to see if it is very different from what I am seeing here.
I am using Docker Desktop Community in windows 10 using Linux containers
I used the following command to start the NEo4j docker container
docker run \
--name neo4j-marvin \
--detach \
--publish=7474:7474 --publish=7687:7687 \
--volume=$HOME/neo4j/data:/data --volume=$HOME/neo4j/logs:/logs \
--env NEO4J_dbms_memory_pagecache_size=1G \
--env NEO4J_dbms_memory_heap_max__size=1G \
--env NEO4J_AUTH=neo4j/marvin \
neo4j:4.1.1
It looks like the issue is caused by the 1GB size of the pagecache and heap size. With these settings I was able to reproduce the issue in the test project locally. Upping both to 2GB fixed the issue. I've not yet run tests to figure out which of the two is causing the issue, or if it is both together. Please try running with parameters of 2G to see if it fixes the problem for you as well.
It looks like the issue is caused by the 1GB size of the pagecache and heap size. With these settings I was able to reproduce the issue in the test project locally. Upping both to 2GB fixed the issue. I've not yet run tests to figure out which of the two is causing the issue, or if it is both together. Please try running with parameters of 2G to see if it fixes the problem for you as well.
Hi, good to hear you were able to reproduce the issue, I will try with 2GB on both settings to see if the problem remains on my side.
@AndyHeap-NeoTech I updated the configuration to 2G for both settings as suggested. I also added an extra test method to make use of FetchAsync()
instead of ToListAsync()
. I am sorry to have to report that the issue remains. I do have new behaviour. When i debug the test, so step into the method, then it works. But when i just run the test it does not complete and I have the behaviour I reported before. Next thing i will do is try with a previous version of the driver as suggested by @bcargill . The debug logs of neo4j are attached.
Thank you for the feedback. I will attempt to reproduce this new behaviour as well so that I investigate it further.
I just downgraded to version 4.0.2 of the driver and now it works as expected, that code is on a separate branch https://github.com/samgerene/neo4j-net-driver-test/tree/driver-version-4-0-2. For the project that I am working on I will downgrade the driver to version 4.0.2 and once this issue is resolved i hope to be able to upgrade to the latest version
Hi @samgerene. I have a potential fix for this issue in a fork. Would you be willing test the fix against your local setup? It has passed everything here, but I would also like to test it against the 'original'. If you are willing then please get the fork from https://github.com/AndyHeap-NeoTech/neo4j-dotnet-driver and use the Neo4j.Driver.csproj as your dependency rather than the Nuget package...it should just drop in.
@AndyHeap-NeoTech great news, i will try it later today and report back here
Release 4.1.1 has now been made available on NuGet. Thank you for your input and help.
I have verified with version 4.1.1 of the NuGet that it is now working as expected. Thanks a lot for the fix,
Neo4j Version: 4.1.1 Community
Neo4j Mode: Single instance
Driver version: .NET driver 4.1.0 Operating System: Docker Container
bug report
The
var records = await cursor.ToListAsync();
never completes using the following queryon the following graph:
I have created a sample project where the issue is demonstrated:
https://github.com/samgerene/neo4j-net-driver-test
I hope you can help me fix this