diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-12-19 16:33:02 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-12-19 16:33:02 +0000 |
| commit | c63aadd5c4a81a2435c5e8660b80a5e352ccd097 (patch) | |
| tree | 05303250634ca38ac9c1107993407b3ea99bbd73 /src | |
| parent | 832a287aa5527e347cdb39961890e11adf555faa (diff) | |
| parent | 76fd4528bbafbccecd8e94f19874e17e85a42959 (diff) | |
| download | rabbitmq-server-git-c63aadd5c4a81a2435c5e8660b80a5e352ccd097.tar.gz | |
merging v1_7 into default
Diffstat (limited to 'src')
| -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 1a5e82d714..d728ef6a76 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -163,15 +163,23 @@ internal_declare(Q = #amqqueue{name = QueueName}, WantDefaultBinding) -> case rabbit_misc:execute_mnesia_transaction( fun () -> 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 |
