Fix synchronisation regression leading to potential deadlock

This commit is contained in:
Julien Viet
2019-10-15 13:51:30 +02:00
parent 21da7a952f
commit d124ed576a
2 changed files with 8 additions and 6 deletions

View File

@@ -204,12 +204,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();
}
@Override

View File

@@ -92,8 +92,8 @@ abstract class VertxHttp2Stream<C extends Http2ConnectionBase> {
void onWritabilityChanged() {
synchronized (conn) {
writable = !writable;
handleInterestedOpsChanged();
}
handleInterestedOpsChanged();
}
void onEnd() {