Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregation Timeout #316

Open
Lazarus404 opened this issue Sep 30, 2019 · 3 comments
Open

Aggregation Timeout #316

Lazarus404 opened this issue Sep 30, 2019 · 3 comments
Labels

Comments

@Lazarus404
Copy link

Hi guys,

I'm getting an error when performing an aggregation on a lot of data

    ** (exit) an exception was raised:
        ** (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:1392: anonymous fn/5 in Stream.resource/3
            (elixir) lib/enum.ex:2507: Enum.take/2

I've tried passing cursor_timeout: false, timeout: 30_000, pool_timeout: 30_000 to the aggregate options, but nothing fixes it. The documentation doesn't state what and where timeout values should be used.

@Lazarus404
Copy link
Author

Anyone? Is there any documentation for this at all? Any suggestions?

@ankhers
Copy link
Collaborator

ankhers commented Oct 4, 2019

Hey,

Unfortunately I have never been able to track this down. I have not personally seen it in my production system, nor have I been able to reliably reproduce any of these timeout issues. If you can give me information about what was happening within your system and possibly if you could find a way to reliably reproduce the issue, it could help in fixing it.

@Orange-Men
Copy link

Orange-Men commented Nov 12, 2019

@ankhers
I have the same issue but I can't understand the pattern when exactly it is thrown and in what circumstances. I guess here plays a role of the amount of data and time of processing (your captain obvious).
I mean that a few identical actions can throw this error or not.

Erlang/OTP 22 [erts-10.4]
Elixir 1.8.2
mongodb 0.4.9
mongodb_ecto 0.2.1
poolboy 1.5.2
{:ok, pid} = Mongo.start_link(database: Application.get_env(:myapp, Repo)[:database])
cursor = Mongo.aggregate(pid, "options", pipeline, [allow_disk_use: true])
prices = Enum.to_list(cursor)
[error] Task #PID<0.11817.0> started from #PID<0.11741.0> terminating
** (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:1377: anonymous fn/5 in Stream.resource/3
    (elixir) lib/enum.ex:3015: Enum.reverse/1
    (elixir) lib/enum.ex:2647: Enum.to_list/1
    (myapp) web/models/action.ex:553: MyApp.Action.get/3
    (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants