summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_msg_store.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl
index 56d65d75e9..32c30e48f9 100644
--- a/src/rabbit_msg_store.erl
+++ b/src/rabbit_msg_store.erl
@@ -1837,11 +1837,12 @@ rebuild_index(Gatherer, Files, State) ->
lists:foreach(fun (File) ->
ok = gatherer:fork(Gatherer)
end, Files),
- spawn(
- fun () ->
- enqueue_build_index_workers(Gatherer, undefined, Files,
- State)
- end),
+ Pid = spawn(
+ fun () ->
+ enqueue_build_index_workers(Gatherer, undefined,
+ Files, State)
+ end),
+ erlang:monitor(process, Pid),
reduce_index(Gatherer, lists:last(Files), State).
%%----------------------------------------------------------------------------