John Yin created CXF-9098:
-----------------------------

             Summary: HttpClient5 throws InterruptedIOException: Output 
operation aborted when sending large payload (36kB+)
                 Key: CXF-9098
                 URL: https://issues.apache.org/jira/browse/CXF-9098
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 4.1.0
         Environment: Windows Server 2016 and Windows 11 Pro.

JDK 17 (Corretto)

Springboot 3.4.0

Camel 4.8.2

CXF 4.1.0
            Reporter: John Yin


When using the hc5 client to send (using PATCH in my case) large payload (> 
36KB, I suspect the threshold is 32KB), the client throws 
InterruptedIOException after exactly one minute from initiating the send.  
Right before the exception, the client wrote the following to log:

2025-01-10 07:07:13.169 [DelayedCachedOutputStreamCleaner] 
DelayedCachedOutputStreamCleaner - Unclosed (leaked?) stream detected: 
[org.apache.cxf.io.CachedOutputStream Content: ...

Here is the stacktrace:

    java.io.InterruptedIOException: Output operation aborted
        at 
org.apache.cxf.transport.http.asyncclient.hc5.SharedOutputBuffer.flushContent(SharedOutputBuffer.java:294)
        at 
org.apache.cxf.transport.http.asyncclient.hc5.SharedOutputBuffer.write(SharedOutputBuffer.java:218)
        at 
org.apache.cxf.transport.http.asyncclient.hc5.AsyncHTTPConduit$AsyncWrappedOutputStream$1.write(AsyncHTTPConduit.java:459)
        at org.apache.cxf.helpers.IOUtils.copy(IOUtils.java:228)
        at org.apache.cxf.helpers.IOUtils.copy(IOUtils.java:179)
        at org.apache.cxf.helpers.IOUtils.copyAndCloseInput(IOUtils.java:185)
        at 
org.apache.cxf.io.CachedOutputStream.writeCacheTo(CachedOutputStream.java:331)
        at 
org.apache.cxf.transport.http.asyncclient.hc5.AsyncHTTPConduit$AsyncWrappedOutputStream.close(AsyncHTTPConduit.java:436)
        at 
org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:77)
        at 
org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:56)
        at 
org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:232)
        at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:717)
        at 
org.apache.cxf.transport.http.HttpClientHTTPConduit.close(HttpClientHTTPConduit.java:261)
        at 
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
        at 
org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:717)
        at 
org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1085)
     [wrapped] jakarta.ws.rs.ProcessingException: 
java.io.InterruptedIOException: Output operation aborted
        at 
org.apache.cxf.jaxrs.client.AbstractClient.checkClientException(AbstractClient.java:645)
        at 
org.apache.cxf.jaxrs.client.AbstractClient.preProcessResult(AbstractClient.java:619)
        at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1149)
        at 
org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1086)
        at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:931)
        at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:900)
        at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:363)
        at 
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.invokeHttpClient(CxfRsProducer.java:339)
        at 
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.process(CxfRsProducer.java:103)
        at 
org.apache.camel.support.SynchronousDelegateProducer.process(SynchronousDelegateProducer.java:48)
        at 
org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:65)
        at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:208)
        at 
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:808)
        at 
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:714)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.doRun(DefaultReactiveExecutor.java:199)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.executeReactiveWork(DefaultReactiveExecutor.java:189)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.tryExecuteReactiveWork(DefaultReactiveExecutor.java:166)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:163)
        at 
org.apache.camel.impl.engine.CamelInternalProcessor.processNonTransacted(CamelInternalProcessor.java:347)
        at 
org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:323)
        at 
org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291)
        at 
org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:191)
        at 
org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:129)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown 
Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 
Source)
        at java.base/java.lang.Thread.run(Unknown Source).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to