Closed ThunderHeavyIndustries closed 3 years ago
@ThunderHeavyIndustries - can you please use the latest published release and let us know if the problem is fixed?! Thank you
Sure thing, I'll give it a go next week and get back to you.
Thanks for getting back to me on this! I'm still experiencing the same issue/seeing the same 1500 ms
response after updating to 2.0.10
.
Maybe there's something on my end? Setup is as above. The function calls look like this:
given a query
which is a string (again verified to work in the Neo4j Desktop client)
def conn() do
Bolt.Sips.conn()
end
def execute(query) do
Bolt.Sips.transaction(conn(), fn con ->
Bolt.Sips.query!(con, query)
end)
end
I also tried passing the timeout as part of the params
def execute(query) do
Bolt.Sips.transaction(conn(), fn con ->
Bolt.Sips.query!(con, query, %{}, timeout: 60_000)
end)
end
Which doesn't change the behavior or the error message either. Thanks again for your help on this!
yeah I am sorry, it was my fault. It should work now with 2.0.11.
Here's one easy way to test, provided you have the APOC enabled:
{:ok, _neo} = Sips.start_link(url: "bolt://neo4j:test@localhost")
conn = Sips.conn()
Sips.query(conn, "CALL apoc.util.sleep(30000) RETURN 1 as test", %{}, timeout: 35_000)
HTH
ah cool ok I'll test it on monday, thanks again!
SO SORRY! Crazy week I'll be checking it out later today!
No worries, please take your time :)) many thanks
Yes indeed updating does seem to respect the timeout when the query is run as presented, with one caveat!
This still seems to be dying with the longer than 15000ms
error message when passed as such:
def execute(query) do
Bolt.Sips.transaction(conn(), fn con ->
Bolt.Sips.query!(con, query)
end)
end
or
def execute(query) do
Bolt.Sips.transaction(conn(), fn con ->
Bolt.Sips.query!(con, query, %{}, timeout: 30_000)
end)
end
but this does respect the timeout whether set from the config, or passed in the params
def execute(query) do
# :timeout set in config
Bolt.Sips.query!(conn(), query, %{})
end
or
def execute(query) do
Bolt.Sips.query!(conn(), query, %{}, timeout: 30_000)
end
Oh that's interesting, thank you for such a thorough investigation and for the examples. I'm going to look into the transaction next, in case it is related, and will report back my findings. Many thanks again!
I see what is going on. When you wrap your queries in transactions, Bolt.Sips delegates the call to the underlining library: DBConnection, including your custom ... options ;)
Please try this instead:
def execute(query) do
Bolt.Sips.transaction(conn(), fn con ->
Bolt.Sips.query!(con, query)
end, timeout: 30_000)
end
I'll give that a go tomorrow!
please reopen, in case you find any other related issue. Thanks again!
Environment
Current behavior
When setup with:
Running a somewhat long query (which is verified to work in the Neo4j desktop client) I'm getting timeout errors:
Expected behavior
Changing the value in the
timeout
field in the configuration fails to be reflected in queries. I've tried setting thetimeout
to lower and higher than15_000
and I still get errors withfor longer than 15000ms
regardless of what thetimeout
is set to in the config.Thanks for your help!