Skip to content

Commit f67a464

Browse files
committed
okhttp: Fix race condition overwriting MAX_CONCURRENT_STREAMS
1 parent f36defa commit f67a464

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,13 +800,13 @@ public void run() {
800800
if (connectingCallback != null) {
801801
connectingCallback.run();
802802
}
803-
// ClientFrameHandler need to be started after connectionPreface / settings, otherwise it
804-
// may send goAway immediately.
805-
executor.execute(clientFrameHandler);
806803
synchronized (lock) {
807804
maxConcurrentStreams = Integer.MAX_VALUE;
808805
startPendingStreams();
809806
}
807+
// ClientFrameHandler need to be started after connectionPreface / settings, otherwise it
808+
// may send goAway immediately.
809+
executor.execute(clientFrameHandler);
810810
if (connectedFuture != null) {
811811
connectedFuture.set(null);
812812
}

0 commit comments

Comments
 (0)