Skip to content

Commit 958dce1

Browse files
author
Hubert Plociniczak
committed
Do not report false timeout reply.
Instead wait infinitely when closing 'standard' channel and wait with timeout on connection close.
1 parent 0f70efe commit 958dce1

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ public synchronized void rpc(Method m, RpcContinuation k)
208208
* Not for regular use. Doesn't do the ensureIsOpen() check.
209209
*/
210210
public AMQCommand quiescingRpc(Method m,
211-
int timeoutMillisec,
212-
final AMQCommand timeoutReply)
211+
int timeoutMillisec)
213212
throws IOException, ShutdownSignalException, TimeoutException
214213
{
215214
SimpleBlockingRpcContinuation k = new SimpleBlockingRpcContinuation();

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,10 @@ public void close(int closeCode,
680680
new AMQImpl.Connection.Close(closeCode, closeMessage, 0, 0);
681681
shutdown(reason, initiatedByApplication, cause);
682682
_channel0.quiescingRpc(reason,
683-
timeout,
684-
new AMQCommand(new AMQImpl.Connection.CloseOk()));
685-
} catch (TimeoutException ise) {
686-
// FIXME: notify about timeout exception ?
683+
timeout);
684+
} catch (TimeoutException tte) {
685+
if (!abort)
686+
throw new ShutdownSignalException(true, true, tte, this);
687687
} catch (ShutdownSignalException sse) {
688688
if (!abort)
689689
throw sse;

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@
6565
public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel {
6666
private static final String UNSPECIFIED_OUT_OF_BAND = "";
6767

68-
public static final int CLOSING_TIMEOUT = 10000; // timeout in milliseconds
69-
7068
/**
7169
* Map from consumer tag to {@link Consumer} instance.
7270
*
@@ -288,11 +286,9 @@ public void close(int closeCode,
288286
// quiescingRpc instead. We ignore the result. (It's always
289287
// close-ok.)
290288
try {
291-
quiescingRpc(reason,
292-
CLOSING_TIMEOUT,
293-
new AMQCommand(new Channel.CloseOk()));
289+
quiescingRpc(reason, -1);
294290
} catch (TimeoutException ise) {
295-
// FIXME: propagate it to the user
291+
// Will never happen since we wait infinitely
296292
} catch (ShutdownSignalException sse) {
297293
// Ignore.
298294
}

0 commit comments

Comments
 (0)