diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2013-02-14 12:51:11 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2013-02-14 12:51:11 +0000 |
| commit | 65f048d2a3ea11e99440756853a7ad8572ac30a1 (patch) | |
| tree | 03a549352a64ea06d736b33ba56e2b31259ebfb3 /src | |
| parent | 57afadecee8ac16a90c14449e86854eb2d0a5b09 (diff) | |
| download | rabbitmq-server-git-65f048d2a3ea11e99440756853a7ad8572ac30a1.tar.gz | |
Don't stomp on the (possible) registered name of the thing that invokes boot/0 or start/0, create a new process to hold the name instead.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 5f36f17d15..ed0152b469 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -342,7 +342,8 @@ handle_app_error(App, Reason) -> throw({could_not_start, App, Reason}). start_it(StartFun) -> - register(rabbit_boot, self()), + Marker = spawn_link(fun() -> receive finished -> ok end end), + register(rabbit_boot, Marker), try StartFun() catch @@ -351,9 +352,7 @@ start_it(StartFun) -> _:Reason -> boot_error(Reason, erlang:get_stacktrace()) after - %% In the boot/0 case the process exits - but in the start/0 - %% case it is some random RPC server and does not. - unregister(rabbit_boot), + Marker ! finished, %% give the error loggers some time to catch up timer:sleep(100) end. |
