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

Oleg Kalnichevski commented on HTTPCORE-605:
--------------------------------------------

[~hpresnall] {{SSLIOSession}} is one of the most complex classes in the library 
and I am reluctant to tinker with it based on assumptions and luck alone. 
Recently we had cases when the infinite loop in a half-closed state was due to 
a bug in the JSSE provider. See HTTPCORE-601 and the corresponding 
[work-around|[https://github.com/apache/httpcomponents-core/commit/b10bd3061fca534322d041fa8a5e4e2ed91eeda5]]
 for context.  So I want to be sure the cause of the loop in the first place.  

Please give me the exact JRE version and the JSSE provider used. Is it the 
default Oracle JSSE provider or is it something else, like Conscrypt TLS?

Oleg  

> Infinite loop on half close
> ---------------------------
>
>                 Key: HTTPCORE-605
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-605
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.4.11
>            Reporter: Hunter Presnall
>            Priority: Major
>
> When the server half-closes the connection, the http client gets stuck in an 
> infinite loop with a writable selection key, but no data to send. They 
> selection key is never cleared and empty buffers are continually sent.
> The stack trace when this happens is:
> {{"I/O dispatcher 2" #30 prio=5 os_prio=0 tid=0x00007fd7cc0a5000 nid=0x2c 
> runnable [0x00007fd7db6fb000]"I/O dispatcher 2" #30 prio=5 os_prio=0 
> tid=0x00007fd7cc0a5000 nid=0x2c runnable [0x00007fd7db6fb000]   
> java.lang.Thread.State: RUNNABLE at sun.nio.ch.NativeThread.current(Native 
> Method) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:468) - 
> locked <0x0000000091fb63b0> (a java.lang.Object) - locked 
> <0x0000000091fb63a0> (a java.lang.Object) at 
> org.apache.http.nio.reactor.ssl.SSLIOSession.sendEncryptedData(SSLIOSession.java:423)
>  at 
> org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:549)
>  - locked <0x0000000091fb6630> (a 
> org.apache.http.nio.reactor.ssl.SSLIOSession) at 
> org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
>  at 
> org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
>  at 
> org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
>  at 
> org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
>  at 
> org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
>  at 
> org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
>  at 
> org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
>  at java.lang.Thread.run(Thread.java:748)}}
>  
> This is similar to 
> [HTTPCORE-528|https://issues.apache.org/jira/browse/HTTPCORE-528]  which was 
> fixed in 4.4.10. When we upgraded the client to 4.4.11, this new issue 
> appeared. I suspect similar handling where there is write interest but no 
> data needs to remove the write mask.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to