From 8a4e73309cc55a70d6388101a5f964e827478dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=91=AB?= Date: Tue, 28 May 2019 14:34:44 -0400 Subject: [PATCH] Fix TimeUnit in ChannelInputStream.close() The `TcpNioConnection.ChannelInputStream.close()` uses wrongly `TimeUnit.SECONDS` for the `pipeTimeout` in the `this.buffers.offer()` call. * The `TimeUnit.MILLISECONDS` must be used instead **Cherry-pick to 5.1.x, 5.0.x, 4.3.x** --- .../integration/ip/tcp/connection/TcpNioConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java index bd1e1721d0..028ed8f7b4 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java @@ -761,7 +761,7 @@ public class TcpNioConnection extends TcpConnectionSupport { super.close(); this.isClosed = true; try { - this.buffers.offer(EOF, TcpNioConnection.this.pipeTimeout, TimeUnit.SECONDS); + this.buffers.offer(EOF, TcpNioConnection.this.pipeTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt();