Skip to content

hanoidb crashes on exit when started by open_link #32

@brigadier

Description

@brigadier

When hanoidb is started supervised like

init([]) ->
    RestartStrategy = one_for_one,
    MaxRestarts = 1,
    MaxSecondsBetweenRestarts = 10,
    SupFlags = {RestartStrategy, MaxRestarts, MaxSecondsBetweenRestarts},

    Restart = transient,
    Shutdown = 2000,
    Type = worker,

    AChild = {hanoidb, {hanoidb, open_link, [{local, hanoi_process}, "somedir.hanoi", []]},
                Restart, Shutdown, Type, [hanoidb]},

    {ok, {SupFlags, [AChild]}}

it crashes when application getting stopped by q() with

[error] Undefined:Undefined   crash: exit:shutdown [{plain_fsm,parent_EXIT,2,[{file,"src/plain_fsm.erl"},{line,508}]},{hanoidb_level,initialize,1,[{file,"src/hanoidb_level.erl"},{line,156}]},{proc_lib,init_p,3,[{file,"proc_lib.erl"},{line,222}]}]

error. There's no error if it gets stopped with hanoidb:close(hanoi_process). prior to q().

I think supervised processes should stop gracefully without manual actions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions