summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Fedotov <dfedotov@pivotal.io>2017-05-11 18:03:46 +0100
committerDaniil Fedotov <dfedotov@pivotal.io>2017-05-11 18:03:46 +0100
commit286e1d080bd265ecca0f256ac3fa4fcef5e61bc9 (patch)
treecfc75b0b8f063d926fcbdbe3e61a41abd0684503 /src
parent886f1999b8da58859eb9d1242a5a2a518586358e (diff)
downloadrabbitmq-server-git-286e1d080bd265ecca0f256ac3fa4fcef5e61bc9.tar.gz
Link Gatherer when rebuilding a message store index.
If index rebuilding worker fails, the failure never reported to a starting message store process. This can cause a deadlock, when a message store process waits for gatherer, and gatherer waits for a worker, which is dead.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_msg_store.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl
index be85091948..275a9127d1 100644
--- a/src/rabbit_msg_store.erl
+++ b/src/rabbit_msg_store.erl
@@ -1765,8 +1765,12 @@ build_index(Gatherer, Left, [],
build_index(Gatherer, Left, [File|Files], State) ->
ok = gatherer:fork(Gatherer),
ok = worker_pool:submit_async(
- fun () -> build_index_worker(Gatherer, State,
- Left, File, Files)
+ fun () ->
+ link(Gatherer),
+ ok = build_index_worker(Gatherer, State,
+ Left, File, Files),
+ unlink(Gatherer),
+ ok
end),
build_index(Gatherer, File, Files, State).