elixir-mongo / mongodb

MongoDB driver for Elixir
Apache License 2.0
571 stars 156 forks source link

timeout #311

Closed Orange-Men closed 5 years ago

Orange-Men commented 5 years ago

Hi :mongodb, "0.4.7"

I was trying to increase of timeout, my conf:

config :myapp, Repo,
  adapter: Mongo.Ecto,
  database: "myapp_dev",
  pool: DBConnection.Poolboy,
  pool_size: 1,
  pool_timeout: 15_000,
  timeout: 15_000,
  connect_timeout_ms: 60_000,
  ownership_timeout: 15_000,
  connect_timeout: 60_000,
  handshake_timeout: 60_000

But it not produced any results:

[error] Mongo.Protocol (#PID<0.3632.1>) disconnected: ** (DBConnection.ConnectionError) client #PID<0.846.0> timed out because it checked out the connection for longer than 5000ms
[error] Task #PID<0.846.0> started from #PID<0.599.0> terminating
** (Mongo.Error) tcp recv: unknown POSIX error - :closed
    (mongodb) lib/mongo/cursor.ex:154: anonymous fn/5 in Enumerable.Mongo.AggregationCursor.start_fun/5

When I hardcoded(changed) default @timeout in 'deps/mongodb/lib/mongo.ex', all works. What I do wrong? Thx

ankhers commented 5 years ago

You seem to be showing a config for the :mongodb_ecto package. Can you reproduce this if you just use this package (:mongodb) directly?

Orange-Men commented 5 years ago

@ankhers What do you mean "use this package (:mongodb) directly" - ?

ankhers commented 5 years ago

Like I said, you showed a configuration for using Ecto. This driver can be used directly without needing Ecto. You can take a look at this projects README for basic usage information. If you think you are already using this driver directly, can you show me an example call that is failing with your timeout issue?

ankhers commented 5 years ago

Closing due to inactivity. Feel free to reopen the issue if you feel it is still an issue and you get me the information I asked for.