summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2017-07-05 14:49:20 +0300
committerMichael Klishin <mklishin@pivotal.io>2017-07-05 14:49:20 +0300
commit46aa5b973645e1ab802006cab1c8af3d77eaf2c9 (patch)
treef820e716786c863a5e1f0fdc76cb3342c9ae9322 /src
parentf5bb52d66f8d2bb76bda13827d1155c90627c54c (diff)
downloadrabbitmq-server-git-46aa5b973645e1ab802006cab1c8af3d77eaf2c9.tar.gz
rabbit_vhost:delete/2: reduce log noise when vhost is already deleted
Some of these errors are a consequence of the current implementation where queues, exchanges, etc are deleted in multiple transactions instead of one.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_vhost.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rabbit_vhost.erl b/src/rabbit_vhost.erl
index aed01bec73..96e8ebda62 100644
--- a/src/rabbit_vhost.erl
+++ b/src/rabbit_vhost.erl
@@ -133,9 +133,12 @@ delete(VHostPath, ActingUser) ->
#exchange{name = Name} <- rabbit_exchange:list(VHostPath)],
Funs = rabbit_misc:execute_mnesia_transaction(
with(VHostPath, fun () -> internal_delete(VHostPath, ActingUser) end)),
+ [case Fun() of
+ ok -> ok;
+ {error, {no_such_vhost, VHostPath}} -> ok
+ end || Fun <- Funs],
ok = rabbit_event:notify(vhost_deleted, [{name, VHostPath},
{user_who_performed_action, ActingUser}]),
- [ok = Fun() || Fun <- Funs],
%% After vhost was deleted from mnesia DB, we try to stop vhost supervisors
%% on all the nodes.
rabbit_vhost_sup_sup:delete_on_all_nodes(VHostPath),