10000 Fix deadlock on close() with congested server. · ftt1024/rabbitmq-java-client@7406632 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7406632

Browse files
author
David Pratt
committed
Fix deadlock on close() with congested server.
The RPC call for close() should not necessarily listen indefinitely, since it will block essentially forever if the server is congested.
1 parent c5cb829 commit 7406632

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,9 @@ public AMQCommand transformReply(AMQCommand command) {
571571
// we wait for the reply. We ignore the result.
572572
// (It's NOT always close-ok.)
573573
notify = true;
574-
k.getReply(-1);
574+
// Should not wait indefinately, since if the server is congested
575+
// the call will lock and never return. This stalls and kills the current thread.
576+
k.getReply(10000);
575577
} catch (TimeoutException ise) {
576578
// Will never happen since we wait infinitely
577579
} catch (ShutdownSignalException sse) {

0 commit comments

Comments
 (0)
0