hanoidb crashes on exit when started by open_link #32

Open
opened 2014-11-26 22:20:23 +00:00 by brigadier · 1 comment
brigadier commented 2014-11-26 22:20:23 +00:00 (Migrated from github.com)

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.

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.
krestenkrab commented 2014-12-03 23:42:10 +00:00 (Migrated from github.com)

Feel free to enlighten me as to how this should best be fixed.

Feel free to enlighten me as to how this should best be fixed.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/hanoidb#32
No description provided.