Skip to content

Commit 35ca7c6

Browse files
author
Matthew Sackman
committed
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.
1 parent cf86b97 commit 35ca7c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/rabbit_writer.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ send_command_and_notify(W, Q, ChPid, MethodRecord, Content) ->
149149

150150
shutdown(W) ->
151151
W ! shutdown,
152+
rabbit_misc:unlink_and_capture_exit(W),
152153
ok.
153154

154155
%---------------------------------------------------------------------------

0 commit comments

Comments
 (0)