florinpatrascu/bolt_sips

timeout is happening while querying.

yatender-oktalk opened this issue · 11 comments

stacktrace

** (Bolt.Sips.Exception) timeout
    (bolt_sips) lib/bolt_sips/query.ex:59: Bolt.Sips.Query.query!/3

Environment

Erlang/OTP 22 
IEx 1.9.1 (compiled with Erlang/OTP 22)
* Neo4j version (Neo4j 3.5.1):
* Bolt.Sips version: "1.5.1",
* Operating system: macOS 10.14.4
* Connection config 
config :bolt_sips, Bolt,
  hostname: 'hostname.com',
  basic_auth: [username: "user", password: "****"],
  port: 7687,
  pool_size: 50,
  max_overflow: 5,
  timeout: 5_000,
  retry_linear_backoff: [delay: 150, factor: 2, tries: 3]

while executing query randomly it gives timeout then again after retrying it works fine. I was using previously :neo4j_sips, "0.2.18", it never gave such timeouts. I decided to move it to this library then this is happening let me know if you want any other info which can help you to debug this issue or in case I'm doing something wrong.

can you time the db response, for the query you're running? It might be that your query takes longer to execute? Also, you might try the latest version of bolt-sips, the 2.0.0-rc.x

The other driver you refer to, was using neo4j's older REST API, for communicating with the server.

No query doesn't take time at all, it's just a simple search query on indexed field with limit 1, sometimes it just execute within 1 ms and sometimes it just don't connect at all, I tried using the 2.0.0-rc.x only but there was also same case so I thought of using this one but this version also gives the same issue.

It’s very weird. I honestly don’t believe it’s from the driver. Since you tried both versions, and thank you for that, you also tried two different implementations of db_connection, the library we use for managing the connections to the server. I highly doubt we would’ve missed a issue like this. But everything it’s possible. Can you make sure the server is responsive?? Of curiosity, is your server running from a Docker container?

Yeah server is responsive, when I restart the application it gives me results but as soon as i keep application idle and don't do any query it starts giving timeout for next queries I do after keeping it idle.
No I'm not running in docker container it's a standalone server only.

for how long was the application "idle"? Also can you please set the :idle_interval to 5000?

also please check: #67, too.

idle_interval: 5000 now

steps I'm doing basically

  • application started
  • did some basic queries (everything worked fine for different-2 queries)
  • kept it idle for 3-4 min
  • did queries (everything worked fine)
  • kept idle for 1 min
  • did queries ( timeout from now on for every query)

#67 I checked already but we are not using any reverse proxy or anything.

I am sorry, I cannot reproduce this. I kept a Neo4j 3.5.3 server open and an app idle for 20 minutes now and I can still get the query running. Forced :idle_interval to 100.

if possible can u give me your email id?

looks like some issue with the Neo4j 3.5.1 only (i guess), when I'm trying with Neo4j 3.5.8 version it hasn't given timeout exception yet, in last 30 mins I'm connected with it and it's working fine till now, will keep you updated.

somehow, everything is working fine now, for Neo4j 3.5.8 & Neo4j 3.5.1 versions.
don't know what was the issue, thank you so much for help.
will close the ticket for now.