File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/main/java/com/rabbitmq/client/impl Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public class ChannelManager {
52
52
private ExecutorService shutdownExecutor ;
53
53
private final ThreadFactory threadFactory ;
54
54
55
- private int channelShutdownTimeout = (int ) ((ConnectionFactory .DEFAULT_HEARTBEAT * 1.05 ) * 1000 );
55
+ private int channelShutdownTimeout = (int ) ((ConnectionFactory .DEFAULT_HEARTBEAT * AMQConnection . CHANNEL_SHUTDOWN_TIMEOUT_MULTIPLIER ) * 1000 );
56
56
57
57
protected final MetricsCollector metricsCollector ;
58
58
Original file line number Diff line number Diff line change @@ -175,15 +175,18 @@ public Void call() throws Exception {
175
175
return null ;
176
176
}
177
177
};
178
+ Future <Void > flushTask = null ;
178
179
try {
179
180
if (this ._shutdownExecutor == null ) {
180
181
flushCallable .call ();
181
182
} else {
182
- Future < Void > flushTask = this ._shutdownExecutor .submit (flushCallable );
183
+ flushTask = this ._shutdownExecutor .submit (flushCallable );
183
184
flushTask .get (SOCKET_CLOSING_TIMEOUT , TimeUnit .SECONDS );
184
185
}
185
186
} catch (Exception e ) {
186
-
187
+ if (flushTask != null ) {
188
+ flushTask .cancel (true );
189
+ }
187
190
}
188
191
try { _socket .close (); } catch (Exception _e ) {}
189
192
}
You can’t perform that action at this time.
0 commit comments