Skip to content

sync_spawn_command hangs for infinity if the vnode crashes or replies {stop, _, _} [JIRA: RIAK-2370] #807

Open
@gatesn

Description

@gatesn

When sending a sync_spawn_command I notice in riak_core_vnode.erl:345 that the {stop, Reason, NewModState} case doesn't reply to the sender. Given that riak_core_vnode_master:148 issues a sync_spawn_command with a timeout of infinity, the caller will hang forever.

A similar thing happens when the vnode crashes during a handle_command. Any other command being handled at the time of the crash will hang forever. I think the vnode_master ought to trap_exits to catch vnode crashes and reply({vnode_error, _} to the sender.

To reproduce:

handle_command(ping, _Sender, State) ->
timer:sleep(5000),
exit(crashing_the_vnode),
{reply, ok, State};

ping() ->
riak_core_vnode_master:sync_spawn_command(Idx, ping, ).

1> spawn(fun() -> :ping() end).
2> :ping().
...
CRASH REPORT ...
...

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