Skip to content

Crash on shutdown in dispatch_awaiting_callers #120

@digitalcora

Description

@digitalcora

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions