Skip to content

Commit

Permalink
Do not return the connection to the pool in case SSLEngine has been c…
Browse files Browse the repository at this point in the history
…losed (#2140)

Fixes #1828
  • Loading branch information
violetagg authored Apr 4, 2022
1 parent 1219040 commit 34837af
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.HttpUtil;
import io.netty.handler.codec.http.HttpVersion;
import io.netty.handler.ssl.SslClosedEngineException;
import io.netty.resolver.AddressResolverGroup;
import io.netty.util.AsciiString;
import io.netty.util.AttributeKey;
Expand Down Expand Up @@ -382,6 +383,16 @@ else if (handler.shouldRetry && AbortedException.isConnectionReset(error)) {
}
}
}
else if (error instanceof SslClosedEngineException) {
if (log.isWarnEnabled()) {
log.warn(format(connection.channel(), "The connection observed an error"), error);
}
HttpClientOperations ops = connection.as(HttpClientOperations.class);
if (ops != null) {
// javax.net.ssl.SSLEngine has been closed, do not return the connection to the pool
ops.markPersistent(false);
}
}
else if (log.isWarnEnabled()) {
log.warn(format(connection.channel(), "The connection observed an error"), error);
}
Expand Down

0 comments on commit 34837af

Please sign in to comment.