rabbitmq / ra

A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
Other
813 stars 96 forks source link

Exception thrown in ra:process_command() when leader stop #310

Closed shino closed 2 years ago

shino commented 2 years ago

When trying to reproduce #309 (which failed), I encountered exceptions thrown in ra:process_command():

  !!!!!!! write error by exception !!!!!!!!!: {exit,
                                             {shutdown,
                                              {gen_statem,call,
                                               [{repro,'n1@127.0.0.1'},
                                                {leader_call,
                                                 {command,normal,
                                                  {'$usr',
                                                   {write,51,51},
                                                   await_consensus}}},
                                                100]}},
                                             [{gen,do_call,4,
                                               [{file,"gen.erl"},{line,266}]},
                                              {gen_statem,
                                               '-call_clean/4-fun-0-',5,
                                               [{file,"gen_statem.erl"},
                                                {line,917}]}]}

Script to reproduce:

Steps to reproduce:

Discussion point: Is the exception above should be catched and converted?

Thanks!