diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-12-19 16:37:52 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-12-19 16:37:52 +0000 |
| commit | 90f9a5f213b1ae2d47c4d78d8e44505c563f285d (patch) | |
| tree | 2b9d4e49a9a2272271c1714ac537a1fdcc3acb46 | |
| parent | c733a53080902ca719ac2029f92615efedc3c1c0 (diff) | |
| parent | 1e2f77364d773a726d775b1a5b76cd599e32e6af (diff) | |
| download | rabbitmq-server-git-90f9a5f213b1ae2d47c4d78d8e44505c563f285d.tar.gz | |
merging default/21673 into bug 22161
| -rw-r--r-- | src/rabbit_amqqueue.erl | 22 | ||||
| -rw-r--r-- | src/rabbit_msg_store.erl | 5 |
2 files changed, 17 insertions, 10 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 diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 6306ac32b0..c8d27ba6bd 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -405,9 +405,8 @@ handle_info({file_handle_cache, maximum_eldest_since_use, Age}, State) -> ok = file_handle_cache:set_maximum_since_use(Age), noreply(State); -handle_info({'EXIT', _Pid, normal}, State) -> - %% this is just the GC process going down - noreply(State). +handle_info({'EXIT', _Pid, Reason}, State) -> + {stop, Reason, State}. terminate(_Reason, State = #msstate { msg_locations = MsgLocations, file_summary = FileSummary, |
