From 796a0c43d2bd7e4422f29472030819e7c61f9d1d 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 a1e5f700ee..a8f4ce8389 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 @@ -765,7 +765,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 (@SuppressWarnings(UNUSED) InterruptedException e) { Thread.currentThread().interrupt();