Skip to content

Commit c9fed7f

Browse files
author
Hubert Plociniczak
committed
Notify pending rpc in the application thread of the shutdown signal only after sending Channel.CloseOk to avoid race condition related to re-using the channel.
1 parent a53866a commit c9fed7f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,12 @@ public void releaseChannelNumber() {
193193
command,
194194
this);
195195
synchronized (_channelMutex) {
196-
processShutdownSignal(signal, true, true);
197-
quiescingTransmit(new Channel.CloseOk());
196+
try {
197+
processShutdownSignal(signal, true, false);
198+
quiescingTransmit(new Channel.CloseOk());
199+
} finally {
200+
notifyOutstandingRpc(signal);
201+
}
198202
}
199203
notifyListeners();
200204
return true;

0 commit comments

Comments
 (0)