Open stanislaw89 opened 1 year ago
Yep - there is a race condition, and when it blocks we are treating them as trailers. I'll try to find the right fix.
I could reproduce with 5.x, so if blocked use that until a release.
I haven't reproduced on 5.x, and that server now doesn't return a 103.
I have some alternate servers, but I think this particular error relates to a 103 and then a response without a body.
https://early-hints.fastlylabs.com/test.png https://tradingstrategy.ai
So I don't have a good repro to confirm the fix.
@swankjesse I think I understand why it's only happening when the response body is empty.
1) timeout - which calls closeInternal 2) closeInternal short circuits because source.finished == true. 3) takeHeaders loops another time, but now without a timeout
Minimal fix in https://github.com/square/okhttp/pull/8054
Steps to reproduce.
Execute the code snipper below multiple times (it reproduces in ~ 1/4 of runs) using
v4.11.0
The main thread hangs forever in waitForIo of Http2Stream#takeHeaders. I investigated a bit, and it looks like it only happens for
103 Early Hints
response codes (inside the CallServerInterceptor#shouldIgnoreAndWaitForRealResponseif
). Also, I figured out that the Http2Stream.StreamTimeout is called after some time, but it does not unblock the main thread.