Content-Length: 256469 | pFad | http://github.com/coderzzg/rabbitmq-java-client/commit/74066327ce15ba9f8e52aa6a5faf7f267dd4e3c4

7C Fix deadlock on close() with congested server. · coderzzg/rabbitmq-java-client@7406632 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/coderzzg/rabbitmq-java-client/commit/74066327ce15ba9f8e52aa6a5faf7f267dd4e3c4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy