StackOverflowError on cypher-shell


I've made a small script (30 lines) using apoc procedures (periodic.iterates, load.csv, do.when & convert.toString).
The loaded csv is 100MB.
The script works fine when launching using cat file.cypher | cypher-shell but I having error when launched using cron

Failed to invoke procedure `apoc.periodic.iterate`: Caused by: java.lang.StackOverflowError

EDIT: And since, right now, the script is now failing even using cat file.cypher | cypher-shell with the same SO error.

Any idea why ?

Switching this command :
{batchSize:10000, iterateList:true, parallel:true, concurrency:10000});
to this one :
{batchSize:1000, iterateList:true, parallel:true, concurrency:1000});
Seems to have fixed the problems.
Is this the normal way to fix it ?

Why would you ever use concurrency 10000? do you have 10000 cores?

Just leave it off, then it uses however many CPUs you have.

1 Like

Hmmmm, OK.
I used this setting because I found it on a gist.
Nice to know it's related to CPU cores.

Thanks @michael_hunger !

Just check the documentation, it's written that the default value for concurrency is 50, I don't think this is the average cores on any computer used for neo4j.
To me the documentation does not help to know it's related to CPU cores.

Which gist was that? We might want to ask the author to fix it.

You're right we might want to reduce that.

But machines that Neo4j runs on (esp. with graph algos) have quite some number of cores. I've definitely seen 32, 64, 96 and 144 core machines running Neo4j.