Arunan Sugunakumar created HTTPCORE-644:
-------------------------------------------

             Summary: High CPU usage noticed for SSLIOSession.close() after JDK 
upgrade
                 Key: HTTPCORE-644
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-644
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore, HttpCore NIO
         Environment: Oracle JDK 1.8.0_261 (released in July 2020)
AdoptOpenJDK (build 11.0.8+10)
All versions after Oracle JDK 11.0.1
            Reporter: Arunan Sugunakumar
         Attachments: image-2020-08-03-13-02-35-195.png

We are using a *forked version (4.3.3)* of HttpCore NIO. We recently had an 
issue because of JDK upgrade. When a HTTPS connection is closed from the server 
side, the server CPU usage seems to be increasing and stays on forever. We 
debugged and found out that after the HTTPS response is written back to the 
client, the server tries to close the connection and the SSLIOSession. Prior to 
JDK 8 261 versions (& Prior to Oracle JDK 11.0.2), after SSLIOSession closes 
the outBound connection, the Handshake status is returned as NEED_UNWRAP. When 
such status is returned, we set the new event Mask as Read EventMask. In the 
new JDK versions it is returned as NOT_HANDSHAKING. In such cases, the 
SSLSession is not getting closed properly, and the server is constantly trying 
to close the connection with Write events which causes the CPU spike. We 
debugged the JDK code, and we were able to find a commit[1], which might have 
caused this behaviour. With this JDK commit, TransportContext Handshake status 
is returned as NOT_HANDSHAKING even after closeOutbound() is called. (The issue 
is reproducible for both TLSv1.2 and TLSv1.3)

 

(Code snippet from JDK 11 commit)

!image-2020-08-03-13-02-35-195.png!

 

*I am not sure, whether this issue is reproducible in the latest HttpCore 
version*. But since this a JDK level change, it might affect all versions. We 
observed the issue with the following JDK versions.
 * Oracle JDK 1.8.0_261 (released in July 2020)
 * AdoptOpenJDK (build 11.0.8+10)
 * All versions after Oracle JDK 11.0.1



--
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