diff --git a/src/main/java/io/vertx/core/http/impl/HttpClientRequestImpl.java b/src/main/java/io/vertx/core/http/impl/HttpClientRequestImpl.java index 78f70ffd2..90202750d 100644 --- a/src/main/java/io/vertx/core/http/impl/HttpClientRequestImpl.java +++ b/src/main/java/io/vertx/core/http/impl/HttpClientRequestImpl.java @@ -200,12 +200,14 @@ public class HttpClientRequestImpl extends HttpClientRequestBase implements Http @Override public synchronized boolean writeQueueFull() { checkEnded(); - if (stream == null) { - // Should actually check with max queue size and not always blindly return false - return false; - } else { - return stream.isNotWritable(); + synchronized (this) { + checkEnded(); + if (stream == null) { + // Should actually check with max queue size and not always blindly return false + return false; + } } + return stream.isNotWritable(); } private synchronized Handler exceptionHandler() { diff --git a/src/main/java/io/vertx/core/http/impl/VertxHttp2Stream.java b/src/main/java/io/vertx/core/http/impl/VertxHttp2Stream.java index eaad99502..aa37f67e2 100644 --- a/src/main/java/io/vertx/core/http/impl/VertxHttp2Stream.java +++ b/src/main/java/io/vertx/core/http/impl/VertxHttp2Stream.java @@ -92,8 +92,8 @@ abstract class VertxHttp2Stream { void onWritabilityChanged() { synchronized (conn) { writable = !writable; - handleInterestedOpsChanged(); } + handleInterestedOpsChanged(); } void onEnd() {