summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2013-09-11 14:57:44 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2013-09-11 14:57:44 +0100
commitecfd2b2f60ad2e5802a5d533234ab28b13cc7bd3 (patch)
treedc08807d145ee95e32809e40e0349a36e075eae2
parentf149982c195173fbee56e23be8fa975d24d143fa (diff)
parent9affd59cdf7f2dcebcddfdf614bcc0da7d7e7fbd (diff)
downloadrabbitmq-server-ecfd2b2f60ad2e5802a5d533234ab28b13cc7bd3.tar.gz
merge stable into default
-rw-r--r--src/rabbit_amqqueue.erl4
-rw-r--r--src/rabbit_amqqueue_process.erl10
-rw-r--r--src/rabbit_channel.erl7
-rw-r--r--src/rabbit_vhost.erl2
4 files changed, 11 insertions, 12 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index 38d72479..65e42383 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -72,8 +72,8 @@
-spec(declare/5 ::
(name(), boolean(), boolean(),
rabbit_framing:amqp_table(), rabbit_types:maybe(pid()))
- -> {'new' | 'existing' | 'absent', rabbit_types:amqqueue()} |
- rabbit_types:channel_exit()).
+ -> {'new' | 'existing' | 'absent' | 'owner_died',
+ rabbit_types:amqqueue()} | rabbit_types:channel_exit()).
-spec(internal_declare/2 ::
(rabbit_types:amqqueue(), boolean())
-> queue_or_absent() | rabbit_misc:thunk(queue_or_absent())).
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index ea0a3153..9704fa79 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -1111,14 +1111,8 @@ handle_call({init, Recover}, From,
declare(Recover, From, State);
false -> #q{backing_queue = undefined,
backing_queue_state = undefined,
- q = #amqqueue{name = QName} = Q} = State,
- gen_server2:reply(From, not_found),
- case Recover of
- new -> rabbit_log:warning(
- "exclusive owner for ~s went away~n",
- [rabbit_misc:rs(QName)]);
- _ -> ok
- end,
+ q = Q} = State,
+ gen_server2:reply(From, {owner_died, Q}),
BQ = backing_queue_module(Q),
BQS = bq_init(BQ, Q, Recover),
%% Rely on terminate to delete the queue.
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index c3780581..431f29d7 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -1022,7 +1022,12 @@ handle_method(#'queue.declare'{queue = QueueNameBin,
%% declare. Loop around again.
handle_method(Declare, none, State);
{absent, Q} ->
- rabbit_misc:absent(Q)
+ rabbit_misc:absent(Q);
+ {owner_died, _Q} ->
+ %% Presumably our own days are numbered since the
+ %% connection has died. Pretend the queue exists though,
+ %% just so nothing fails.
+ return_queue_declare_ok(QueueName, NoWait, 0, 0, State)
end;
{error, {absent, Q}} ->
rabbit_misc:absent(Q)
diff --git a/src/rabbit_vhost.erl b/src/rabbit_vhost.erl
index fcf77bf9..8d013d43 100644
--- a/src/rabbit_vhost.erl
+++ b/src/rabbit_vhost.erl
@@ -122,7 +122,7 @@ with(VHostPath, Thunk) ->
end.
%% Like with/2 but outside an Mnesia tx
-assert(VHostPath) -> case rabbit_vhost:exists(VHostPath) of
+assert(VHostPath) -> case exists(VHostPath) of
true -> ok;
false -> throw({error, {no_such_vhost, VHostPath}})
end.