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

   **[Arunan 
Sugunakumar](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=arunans23)**
 opened 
**[HTTPCORE-644](https://issues.apache.org/jira/browse/HTTPCORE-644?redirect=false)**
 and commented
   
   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
   
    
   
   Any help here is appreciated.  
   
    
   
   [1]- 
https://github.com/AdoptOpenJDK/openjdk-jdk11u/commit/8d1b63a4db2c6348a97b3cf45bd4d2caa7cad6b5
   
   
   ---
   
   **Attachments:**
   - 
[HttpNIOTestServer.zip](https://issues.apache.org/jira/secure/attachment/13013944/HttpNIOTestServer.zip)
 (_14.15 kB_)
   - 
[image-2020-08-03-13-02-35-195.png](https://issues.apache.org/jira/secure/attachment/13008934/image-2020-08-03-13-02-35-195.png)
 (_56.59 kB_)
   - [Screenshot 2020-08-04 at 
08.48.18.png](https://issues.apache.org/jira/secure/attachment/13009009/Screenshot+2020-08-04+at+08.48.18.png)
 (_134.62 kB_)
   - [Screenshot 2020-08-04 at 
08.53.58.png](https://issues.apache.org/jira/secure/attachment/13009008/Screenshot+2020-08-04+at+08.53.58.png)
 (_32.57 kB_)
   - [Screenshot 2020-08-04 at 
08.57.47.png](https://issues.apache.org/jira/secure/attachment/13009010/Screenshot+2020-08-04+at+08.57.47.png)
 (_771.22 kB_)
   
   **Backported to:** 
[5.0.3](https://github.com/apache/httpcomponents-core/milestone/72?closed=1), 
[4.4.14](https://github.com/apache/httpcomponents-core/milestone/51?closed=1)
   


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