diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-12-19 16:36:25 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-12-19 16:36:25 +0000 |
| commit | 1e2f77364d773a726d775b1a5b76cd599e32e6af (patch) | |
| tree | d7b76809bdb510b51adcbca238c58836ccbc0be0 | |
| parent | 4130618aac68fc5903ed7ddeae95ba538f2f3ba5 (diff) | |
| parent | c63aadd5c4a81a2435c5e8660b80a5e352ccd097 (diff) | |
| download | rabbitmq-server-git-1e2f77364d773a726d775b1a5b76cd599e32e6af.tar.gz | |
merging default into bug 21673
| -rw-r--r-- | src/rabbit_amqqueue.erl | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index e5a113ae97..77dbf03d87 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -187,15 +187,23 @@ internal_declare(Q = #amqqueue{name = QueueName}, WantDefaultBinding) -> %% another node, beyond the knowledge of our own %% local queue_sup. case mnesia:wread({rabbit_queue, QueueName}) of - [] -> ok = store_queue(Q), - case WantDefaultBinding of - true -> add_default_binding(Q); - false -> ok - end, - Q; - [ExistingQ] -> ExistingQ + [] -> + case mnesia:read( + {rabbit_durable_queue, QueueName}) of + [] -> ok = store_queue(Q), + case WantDefaultBinding of + true -> add_default_binding(Q); + false -> ok + end, + Q; + [_] -> not_found %% existing Q on stopped node + end; + [ExistingQ] -> + ExistingQ end end) of + not_found -> exit(Q#amqqueue.pid, shutdown), + rabbit_misc:not_found(QueueName); Q -> Q; ExistingQ -> exit(Q#amqqueue.pid, shutdown), ExistingQ |
