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

Crash on shutdown in dispatch_awaiting_callers #120

Open
digitalcora opened this issue Dec 1, 2021 · 3 comments
Open

Crash on shutdown in dispatch_awaiting_callers #120

digitalcora opened this issue Dec 1, 2021 · 3 comments

Comments

@digitalcora
Copy link

I noticed a flaky test failure with the reason ** (exit) shutdown, and the following output logged:

** (stop) exited in: GenServer.stop(:normal, :normal, :infinity)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir 1.12.1) lib/gen_server.ex:972: GenServer.stop/3
    (bypass 2.1.0) lib/bypass/instance.ex:385: Bypass.Instance.dispatch_awaiting_callers/1
    (bypass 2.1.0) lib/bypass/instance.ex:62: Bypass.Instance.handle_info/2
    (stdlib 3.14) gen_server.erl:689: :gen_server.try_dispatch/4
    (stdlib 3.14) gen_server.erl:765: :gen_server.handle_msg/6
    (stdlib 3.14) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Looking at the referenced code, it seems GenServer.stop/3 is not being called correctly: the first argument is supposed to be a reference to a server, but the Bypass code is GenServer.stop(:normal). So if there are any callers_awaiting_exit, this code will always crash.

@zraul123
Copy link

Any updates on this? We're seeing the same behavior causing flaky tests. Lately, for some reason, it started failing fairly often.

@firestack
Copy link

We've been having this happen more frequently (almost every CI run, rarely when run locally) since we updated to elixir 1.15.

I've tried fixing this locally by changing the GenServer.stop/3 call to be GenServer.stop(__MODULE__, :normal) in a local checkout, but I'm still having the issue where the test fails with ** (exit) shutdown, so while this needs to be fixed, I'm not sure it's the root cause of the test failure.

@grzuy
Copy link

grzuy commented Sep 10, 2024

Cross linking with opened pull requests that are attempting to fix this issue (I think):

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

No branches or pull requests

4 participants