florinpatrascu / bolt_sips

Neo4j driver for Elixir
Apache License 2.0
256 stars 49 forks source link

Time out for some queries #43

Closed yoelfme closed 6 years ago

yoelfme commented 6 years ago

Hello, I started to play with bolt sips 3 weeks ago, and today I deployed my service to my staging enviroment but I have found some issues:

I'm receiving a time out error when I made query like this:

"MATCH (s) WHERE id(s) = {start_node_id}\nMATCH (e) WHERE id(e) = {end_node_id}\nCREATE (s)-[relationship:WRITES{created_at: {created_at}, source: {source}}]->(e)\nRETURN relationship", %{created_at: 1521829096, end_node_id: 1888, source: "messenger", start_node_id: 2467}

My logs:

3/23/2018 12:18:31 PM ** (exit) exited in: :gen_server.call(#PID<0.1494.0>, {#Port<0.3962>, "MATCH (s) WHERE id(s) = {start_node_id}\nMATCH (e) WHERE id(e) = {end_node_id}\nCREATE (s)-[relationship:WRITES{created_at: {created_at}, source: {source}}]->(e)\nRETURN relationship", %{created_at: 1521829096, end_node_id: 1888, source: "messenger", start_node_id: 2467}}, 15000)
3/23/2018 12:18:31 PM    ** (EXIT) time out

But when I made queries like this:

"MATCH (node:USER)-[:WRITES]->(:BOT{bot_id:{bot_id}})\nRETURN node\nORDER BY node.created_at", %{bot_id: "my-bot"}

I got the results that I expect.

Environment:

Annd my bolt sips configuration:

config :bolt_sips, Bolt,
  hostname: "localhost",
  port: 7687,
  pool_size: 5,
  max_overflow: 1

It would be great to get your feedback about this issue.

Thanks for your help

florinpatrascu commented 6 years ago

Hi there - I'll have to look at the query implementation, but a bit later on, when I can access my computer. Did you try running this:

MATCH (s) WHERE id(s) = 2467
MATCH (e) WHERE id(e) = 1888
CREATE (s)-[relationship:WRITES{created_at: 1521829096, source: "messenger"}]->(e)
RETURN relationship

from Neo4j's own UI? Is it working? I guess it does, but I thought I'd ask. Seems like the server is exceeding the timeout threshold and the request throws that error you see in the logs.

Also, please use the driver's latest version, from master; see: #41, for more details.

yoelfme commented 6 years ago

Hi @florinpatrascu, thanks for your answer, that query works in my Neo4j implementation. I will try the driver's latest version, maybe that works fix the issue. Thanks for all, I will let you now how it turns out.

yoelfme commented 6 years ago

Hi @florinpatrascu, I forgot to answer the solution to this issue, it worked with the driver's latest version, thanks a lot for your help

florinpatrascu commented 6 years ago

No worries, I figured it will be ok ;)