jira-importer opened a new issue, #801:
URL: https://github.com/apache/httpcomponents-core/issues/801

   **[David 
Koski](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dkoski)** 
opened 
**[HTTPCORE-117](https://issues.apache.org/jira/browse/HTTPCORE-117?redirect=false)**
 and commented
   
   I ran into some trouble where I had a connection that was timing out but 
still had unsent data.  This method gets called:
   
   org.apache.http.impl.nio.DefaultClientIOEventDispatch.timeout(IOSession)
   
   which calls these (in my case):
   
   
org.apache.http.nio.protocol.BufferingHttpClientHandler.timeout(NHttpClientConnection)
   
   org.apache.http.impl.nio.NHttpConnectionBase.close()
   
   finally coming to close the connection itself:
   
       public void close() throws IOException {
           this.closed = true;
           if (this.outbuf.hasData()) {
               this.session.setEvent(EventMask.WRITE);
           } else {
               this.session.close();
           }
       }
   
   However, this.outbuf DID have data, so it just marked itself for writing.  
The connection was in no better shape, so after the connect timeout expired, it 
called this method again.  And again.  There may be a good reason that it was 
done this way, but it looks like it causes a problem.
   
   I am not sure what state the connection was in, but it looked like the 
connection was established and NO data had been sent.  I noticed that the 
hasBufferedOutput flag was false, though there was actually data to send.  That 
is set here:
   
       public void produceOutput(final NHttpClientHandler handler) {
   
   ...
   } finally {
   // Finally set buffered output flag
   this.hasBufferedOutput = this.outbuf.hasData();
   }
   
   which suggests that this method was never called.  I can't say if that was a 
problem in the client or the server (load balancer in this case) just wasn't 
handling any input.
   
   
   ---
   
   **Affects:** 4.0-alpha5
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to