You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2020/10/21 20:35:33 UTC

[httpcomponents-core] branch master updated: HTTPCORE-644: non-blocking TLSv1.3 connections can end up in an infinite event spin when closed concurrently by the local and the remote endpoints

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 46a0652  HTTPCORE-644: non-blocking TLSv1.3 connections can end up in an infinite event spin when closed concurrently by the local and the remote endpoints
46a0652 is described below

commit 46a06524e14c280bb3be13f26e34add91fd82e3a
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Oct 21 22:34:18 2020 +0200

    HTTPCORE-644: non-blocking TLSv1.3 connections can end up in an infinite event spin when closed concurrently by the local and the remote endpoints
---
 .../src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
index c135ea4..806794c 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
@@ -435,11 +435,15 @@ public class SSLIOSession implements IOSession {
 
             if (this.endOfStream && !this.inPlain.hasData()) {
                 newMask = newMask & ~EventMask.READ;
+            } else if (this.status == Status.CLOSING) {
+                newMask = newMask | EventMask.READ;
             }
 
             // Do we have encrypted data ready to be sent?
             if (this.outEncrypted.hasData()) {
                 newMask = newMask | EventMask.WRITE;
+            } else if (this.sslEngine.isOutboundDone()) {
+                newMask = newMask & ~EventMask.WRITE;
             }
 
             // Update the mask if necessary


Re: [httpcomponents-core] branch master updated: HTTPCORE-644: non-blocking TLSv1.3 connections can end up in an infinite event spin when closed concurrently by the local and the remote endpoints

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2020-10-21 at 16:41 -0400, Gary Gregory wrote:
> I've recently had a case where a customer is forcing everything on
> TLSv1.2
> but it is not related to this. Still, we might want to consider
> release
> soonish.
> 

Agreed. The issue is nasty enough to warrant a release soon.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: [httpcomponents-core] branch master updated: HTTPCORE-644: non-blocking TLSv1.3 connections can end up in an infinite event spin when closed concurrently by the local and the remote endpoints

Posted by Gary Gregory <ga...@gmail.com>.
I've recently had a case where a customer is forcing everything on TLSv1.2
but it is not related to this. Still, we might want to consider release
soonish.

Gary

On Wed, Oct 21, 2020 at 4:35 PM <ol...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> olegk pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
>
>
> The following commit(s) were added to refs/heads/master by this push:
>      new 46a0652  HTTPCORE-644: non-blocking TLSv1.3 connections can end
> up in an infinite event spin when closed concurrently by the local and the
> remote endpoints
> 46a0652 is described below
>
> commit 46a06524e14c280bb3be13f26e34add91fd82e3a
> Author: Oleg Kalnichevski <ol...@apache.org>
> AuthorDate: Wed Oct 21 22:34:18 2020 +0200
>
>     HTTPCORE-644: non-blocking TLSv1.3 connections can end up in an
> infinite event spin when closed concurrently by the local and the remote
> endpoints
> ---
>  .../src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java   | 4
> ++++
>  1 file changed, 4 insertions(+)
>
> diff --git
> a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
> b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
> index c135ea4..806794c 100644
> ---
> a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
> +++
> b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
> @@ -435,11 +435,15 @@ public class SSLIOSession implements IOSession {
>
>              if (this.endOfStream && !this.inPlain.hasData()) {
>                  newMask = newMask & ~EventMask.READ;
> +            } else if (this.status == Status.CLOSING) {
> +                newMask = newMask | EventMask.READ;
>              }
>
>              // Do we have encrypted data ready to be sent?
>              if (this.outEncrypted.hasData()) {
>                  newMask = newMask | EventMask.WRITE;
> +            } else if (this.sslEngine.isOutboundDone()) {
> +                newMask = newMask & ~EventMask.WRITE;
>              }
>
>              // Update the mask if necessary
>
>