Fix synchronisation regression leading to potential deadlock

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

View File

@@ -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<Throwable> exceptionHandler() {

View File

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