This is an automated email from the ASF dual-hosted git repository. reta pushed a commit to branch 4.0.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git
commit e5bfff5dae74ffda55f77ffdc9fbb41e14861558 Author: Andriy Redko <[email protected]> AuthorDate: Sat Nov 8 09:01:51 2025 -0500 CXF-9173: Default SO_LINGER induce TCP RST on each connection closure (#2715) (cherry picked from commit 8018384606b2c1dfee8a769edfe19254d2295024) --- .../http/asyncclient/hc5/AsyncHTTPConduitFactory.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitFactory.java b/rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitFactory.java index 634843dc19..f23cdfec8b 100644 --- a/rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitFactory.java +++ b/rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitFactory.java @@ -151,9 +151,9 @@ public class AsyncHTTPConduitFactory implements HTTPConduitFactory { private int ioThreadCount = IOReactorConfig.DEFAULT.getIoThreadCount(); private long selectInterval = IOReactorConfig.DEFAULT.getSelectInterval().toMilliseconds(); - private int soLinger = IOReactorConfig.DEFAULT.getSoLinger().toMillisecondsIntBound(); + private TimeValue soLinger = IOReactorConfig.DEFAULT.getSoLinger(); private int soTimeout = IOReactorConfig.DEFAULT.getSoTimeout().toMillisecondsIntBound(); - private boolean soKeepalive = IOReactorConfig.DEFAULT.isSoKeepalive(); + private boolean soKeepalive = IOReactorConfig.DEFAULT.isSoKeepAlive(); private boolean tcpNoDelay = true; @@ -223,11 +223,13 @@ public class AsyncHTTPConduitFactory implements HTTPConduitFactory { selectInterval = getInt(s.get(SELECT_INTERVAL), 1000); changed |= l != selectInterval; - i = soLinger; - soLinger = getInt(s.get(SO_LINGER), -1); - changed |= i != soLinger; + i = soLinger.toSecondsIntBound(); + // SO_LINGER timeout is set in seconds + soLinger = TimeValue.ofSeconds(getInt(s.get(SO_LINGER), -1)); + changed |= i != soLinger.toSecondsIntBound(); i = soTimeout; + // SO_TIMEOUT timeout is set in milliseconds soTimeout = getInt(s.get(SO_TIMEOUT), 0); changed |= i != soTimeout; @@ -338,7 +340,7 @@ public class AsyncHTTPConduitFactory implements HTTPConduitFactory { final IOReactorConfig config = IOReactorConfig.custom() .setIoThreadCount(ioThreadCount) .setSelectInterval(TimeValue.ofMilliseconds(selectInterval)) - .setSoLinger(TimeValue.ofMilliseconds(soLinger)) + .setSoLinger(soLinger) .setSoTimeout(Timeout.ofMilliseconds(soTimeout)) .setSoKeepAlive(soKeepalive) .setTcpNoDelay(tcpNoDelay)
