8000 Merge pull request #46 from dpratt/stable · ThinkLib/rabbitmq-java-client@a1156ad · GitHub
[go: up one dir, main page]

Skip to content

Commit a1156ad

Browse files
Merge pull request rabbitmq#46 from dpratt/stable
Fix deadlock on close() with congested server.
2 parents c5cb829 + 7406632 commit a1156ad

File tree

1 file changed

+3
-1
lines changed< 8000 /span>

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