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

java.lang.StackOverflowError: null at org.neo4j.cypher.internal.compiler.v2_2.ast.rewriters.expandStar$$anonfun$1$$anonfun$apply$1.apply(expandStar.scala:35) #4783

Closed
ceefour opened this issue Jun 7, 2015 · 5 comments
Labels

Comments

@ceefour
Copy link
Contributor

ceefour commented Jun 7, 2015

neo4j 2.2.2

Error:

java.lang.StackOverflowError: null
    at org.neo4j.cypher.internal.compiler.v2_2.ast.rewriters.expandStar$$anonfun$1$$anonfun$apply$1.apply(expandStar.scala:35)
    at org.neo4j.cypher.internal.compiler.v2_2.replace.apply(Rewritable.scala:208)
    at org.neo4j.cypher.internal.compiler.v2_2.replace$$anon$2.expand(Rewritable.scala:198)
    at org.neo4j.cypher.internal.compiler.v2_2.ast.rewriters.expandStar$$anonfun$1$$anonfun$apply$1.apply(expandStar.scala:35)
...REPEATS...
    at org.neo4j.cypher.internal.compiler.v2_2.replace.apply(Rewritable.scala:208)
    at org.neo4j.cypher.internal.compiler.v2_2.replace$$anon$2.expand(Rewritable.scala:198)
    at org.neo4j.cypher.internal.compiler.v2_2.ast.rewriters.expandStar$$anonfun$1$$anonfun$apply$1.apply(expandStar.scala:35)

How to reproduce:

  1. Clone https://github.com/ceefour/opencog-neo4j/tree/cypher-2.2.2-stackoverflow tag cypher-2.2.2-stackoverflow
  2. Grab the file https://gist.github.com/ceefour/b546d8636766a3bc5056
  3. Run ImportBio2App main class using arguments: Lifespan-observations_2015-02-21.scm ~/tmp/lifespan.neo4j

It will generate the error.

@jexp
Copy link
Member

jexp commented Jun 7, 2015

Does it generate a gigantic cypher statement (which is not recommended anyway) or many smaller ones?

@ceefour
Copy link
Contributor Author

ceefour commented Jun 7, 2015

Yups, a gigantic Cypher

@jexp
Copy link
Member

jexp commented Jun 7, 2015

I think the parser was never meant to parse gigantic statements, and it will be very inefficient to plan and execute.

I very much recommend splitting it into many small similar, parametrized statements which can be executed in a batch (e.g. 1k simple statements http-request) but also concurrently (with 2.2.x concurrent write load is really high).

@ceefour
Copy link
Contributor Author

ceefour commented Jun 7, 2015

It's not using HTTP though, but embedded.

What's the best practice when using smaller statements? 10000 statements in 1 transaction, or 10000 statements in 10000 transactions?

@jexp
Copy link
Member

jexp commented Jun 7, 2015

10k statements per tx are fine.
If you can write concurrently you can also do 1k statements per tx and then use 12 to 32 concurrent write threads.

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

No branches or pull requests

3 participants