summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2020-02-18 20:50:26 +0300
committerMichael Klishin <michael@clojurewerkz.org>2020-02-18 20:50:51 +0300
commitfd66eb3778ef828523d2bf3229944e85e5a7b01a (patch)
treef7b64b0b6ae97353636ae417c25c789c8397e424
parent3aa744ff56946e291e898bb6482248da626ea3a2 (diff)
downloadrabbitmq-server-git-fd66eb3778ef828523d2bf3229944e85e5a7b01a.tar.gz
Make gatherer:stop/1 unlink the process
The only way to start a gatherer process is via gatherer:start_link/1. This means that when a gatherer is stopped, its linked process may unexpectedly receive an exit notification on clean gatherer shutdown. It would be less surprising to the module user if a successful stop also unlinked this transient in nature process. Per discussion with @dcorbacho @dumbbell.
-rw-r--r--src/gatherer.erl1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gatherer.erl b/src/gatherer.erl
index 52efef2bbb..99a487ed12 100644
--- a/src/gatherer.erl
+++ b/src/gatherer.erl
@@ -56,6 +56,7 @@ start_link() ->
-spec stop(pid()) -> 'ok'.
stop(Pid) ->
+ unlink(Pid),
gen_server2:call(Pid, stop, infinity).
-spec fork(pid()) -> 'ok'.