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 | 29d0633258b641ba97b373b2395ce7543c0f5bba (patch) | |
tree | 03a549352a64ea06d736b33ba56e2b31259ebfb3 | |
parent | ae3922b6d9c69c508d984c14cdaec2b1730c5f4e (diff) | |
download | rabbitmq-server-29d0633258b641ba97b373b2395ce7543c0f5bba.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.
-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 5f36f17d..ed0152b4 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. |