[ 
https://issues.apache.org/jira/browse/CXF-9271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140946#comment-18140946
 ] 

Alexander Glazovskiy commented on CXF-9271:
-------------------------------------------

Proposed fix: two lines, in SharedInputBuffer.
     public void close() {
         if (this.shutdown) {
             return;
         }
         this.endOfStream = true;
         this.lock.lock();
         try {
             this.condition.signalAll();
+            this.suspendInput.signalAll();
         } finally {
             this.lock.unlock();
         }
     }

     public void shutdown() {
         if (this.shutdown) {
             return;
         }
         this.shutdown = true;
         this.lock.lock();
         try {
             this.condition.signalAll();
+            this.suspendInput.signalAll();
         } finally {
             this.lock.unlock();
         }
     }

> http-hc5: SharedInputBuffer.consumeContent() can park the I/O reactor thread 
> forever — close()/shutdown() never signal suspendInput
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-9271
>                 URL: https://issues.apache.org/jira/browse/CXF-9271
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 4.2.4
>         Environment: Apache CXF 4.2.4 (also reproduces on 4.2.x)
> Module: rt/transports/http-hc5
> httpclient5 / httpcore5 5.4.x
>            Reporter: Alexander Glazovskiy
>            Priority: Critical
>
> SharedInputBuffer.consumeContent() waits on the suspendInput condition when 
> the internal buffer is full, but close() and shutdown() only signal the other 
> condition. If either method is called while a dispatch thread is parked in 
> consumeContent(), that thread is never woken up and the I/O reactor 
> permanently loses one of its threads.
> Under load this compounds into complete connection-pool starvation and 
> OutOfMemoryError.
> It can be reproduced with any SOAP call whose response body is larger than 
> chunkLength, where the subscription is cancelled while the body is still 
> being received.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to