diff options
| author | Gabriele Santomaggio <gsantomaggio@suse.com> | 2020-01-22 17:56:42 +0100 |
|---|---|---|
| committer | Gabriele Santomaggio <gsantomaggio@suse.com> | 2020-01-22 17:56:42 +0100 |
| commit | 96830f0b84c6c6c29d4ac5013329b8725518a534 (patch) | |
| tree | 0d6bd0fb974a51cf6fbc26cf89821627f504e19a | |
| parent | d8f94900f087d7a381280bc46084ee859d4cd5ed (diff) | |
| download | rabbitmq-server-git-96830f0b84c6c6c29d4ac5013329b8725518a534.tar.gz | |
Handle timeout error on the rebalance function
Fixes: https://github.com/rabbitmq/rabbitmq-server/issues/2214
| -rw-r--r-- | src/rabbit_quorum_queue.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_quorum_queue.erl b/src/rabbit_quorum_queue.erl index b8df6a3028..d0ffb43682 100644 --- a/src/rabbit_quorum_queue.erl +++ b/src/rabbit_quorum_queue.erl @@ -963,8 +963,12 @@ transfer_leadership(Q, Destination) -> {RaName, _} = Pid = amqqueue:get_pid(Q), case ra:transfer_leadership(Pid, {RaName, Destination}) of ok -> - {_, _, {_, NewNode}} = ra:members(Pid), - {migrated, NewNode}; + case ra:members(Pid) of + {_, _, {_, NewNode}} -> + {migrated, NewNode}; + {timeout, _} -> + {not_migrated, ra_members_timeout} + end; already_leader -> {not_migrated, already_leader}; {error, Reason} -> |
