diff --git a/vertx-core/src/main/java/io/vertx/core/http/impl/http2/codec/Http2ClientConnectionImpl.java b/vertx-core/src/main/java/io/vertx/core/http/impl/http2/codec/Http2ClientConnectionImpl.java index 54825810df9..dcca98bfbfc 100644 --- a/vertx-core/src/main/java/io/vertx/core/http/impl/http2/codec/Http2ClientConnectionImpl.java +++ b/vertx-core/src/main/java/io/vertx/core/http/impl/http2/codec/Http2ClientConnectionImpl.java @@ -62,6 +62,8 @@ public class Http2ClientConnectionImpl extends Http2ConnectionImpl implements Ht this.authority = authority; this.lifetimeEvictionTimestamp = maxLifetime > 0 ? System.currentTimeMillis() + maxLifetime : Long.MAX_VALUE; this.handler = connHandler; + // Ensure that the expirationTimestamp is initialized + recycle(); } @Override @@ -199,8 +201,9 @@ private void recycle() { @Override void onStreamClosed(Http2Stream s) { - super.onStreamClosed(s); + // Prepare this connection for returning as onStreamClosed() will return it to the pool. recycle(); + super.onStreamClosed(s); } @Override