summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-07-05 16:35:15 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-07-05 16:35:15 +0100
commitcef5c164fe09d12befde719fd086736e710e55cd (patch)
treefbffa39008aa246f751dd64022df5b8e28403643
parent8af1cb807ba9ae63e6a67a81cb5f4bb71fb06ef0 (diff)
downloadrabbitmq-server-bug22938.tar.gz
Ensure that after asking the writer to exit, we unlink from it. We're usually in the channel when we ask it to exit anyway, which has trap_exits on, so the selective receive is appropriate. In the erlang client we're in amqp_network_connection, which also has trap_exits on, so it's fine there too. However, the point is to ensure the *writer* isn't destroyed early by the channel exiting too quickly, not the other way around, and without turning on trap_exits in the writer.bug22938
-rw-r--r--src/rabbit_writer.erl1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rabbit_writer.erl b/src/rabbit_writer.erl
index 3d10dc12..233d7291 100644
--- a/src/rabbit_writer.erl
+++ b/src/rabbit_writer.erl
@@ -149,6 +149,7 @@ send_command_and_notify(W, Q, ChPid, MethodRecord, Content) ->
shutdown(W) ->
W ! shutdown,
+ rabbit_misc:unlink_and_capture_exit(W),
ok.
%---------------------------------------------------------------------------