diff options
| -rw-r--r-- | src/rabbit_vhost_sup_watcher.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rabbit_vhost_sup_watcher.erl b/src/rabbit_vhost_sup_watcher.erl index 7d9f941040..9c166e5b98 100644 --- a/src/rabbit_vhost_sup_watcher.erl +++ b/src/rabbit_vhost_sup_watcher.erl @@ -52,7 +52,14 @@ handle_info(check_vhost, VHost) -> rabbit_log:error("Virtual host '~s' is gone. " "Stopping message store supervisor.", [VHost]), - {stop, normal, VHost} + %% Stop vhost's top supervisor in a one-off process to avoid a deadlock: + %% us (a child process) waiting for supervisor shutdown and our supervisor(s) + %% waiting for us to shutdown. + spawn( + fun() -> + rabbit_vhost_sup_sup:stop_and_delete_vhost(VHost) + end), + {noreply, VHost} end; handle_info(_, VHost) -> {noreply, VHost}. |
