This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/main by this push:
new 8018384606 CXF-9173: Default SO_LINGER induce TCP RST on each
connection closure (#2715)
8018384606 is described below
commit 8018384606b2c1dfee8a769edfe19254d2295024
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)
---
.../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 5b98bf1434..75deb097ac 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)