I defined children in main project file.
mongo_options = [ hostname: db_host,
port: db_port,
database: db_name,
name: :mongo_db,
pool: DBConnection.Poolboy ]
children = [
worker(Mongo, [mongo_options])
]
Any I have a aggregation query takes time.
arrr_opts = [allow_disk_use: true,
timeout: 15_000,
pool_timeout: 15_000,
pool: DBConnection.Poolboy]
Mongo.aggregate(:mongo_db, “asset”, pipeline, aggr_opts)
|> Enum.to_list()
When I run the code, I receive below error when it passed 5 sec.
2018-03-01 15:10:20.604 [error] module=DBConnection.Connection function=disconnect/2 line=181 Mongo.Protocol (#PID<0.387.0>) disconnected: ** (Mongo.Error) tcp recv: unknown POSIX error - :timeout
** (Mongo.Error) tcp recv: unknown POSIX error - :timeout
(mongodb) lib/mongo/cursor.ex:154: anonymous fn/5 in Enumerable.Mongo.AggregationCursor.start_fun/5
(elixir) lib/stream.ex:1270: anonymous fn/5 in Stream.resource/3
(elixir) lib/enum.ex:1838: Enum.reverse/1
(elixir) lib/enum.ex:2596: Enum.to_list/1
:timeout seems to be working, but pool_timeout is not.
Anybody has any idea why it is not working?
Thank you adavance.
ihkim.