title: OkHttp3 block on Http2Stream.waitForIo()
body: <pre><code>stackTrace:
  java.lang.Thread.State: WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  at java.lang.Object.wait(Object.java:502)
  at okhttp3.internal.http2.Http2Stream.waitForIo(Http2Stream.java:645)
  at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.java:151)
  - locked &lt;0x00000006f12faee8&gt; (a okhttp3.internal.http2.Http2Stream)
  at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.java:136)
  at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
  at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
  at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
  at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
  at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
  at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
  at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
  at okhttp3.RealCall.execute(RealCall.java:81)
  </code></pre>
  <p>version: 3.14.2</p>
  <p>Similar feedback:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/70391371/okhttp-anr-at-okhttp3-internal-http2-http2stream-waitforiookhttphttp2stream-kt">android - OkHttp ANR at okhttp3.internal.http2.Http2Stream.waitForIo$okhttp(Http2Stream.kt:716) - Stack Overflow</a></li>
  <li><a href="https://github.com/square/okhttp/issues/3246" rel="nofollow noreferrer">Http2Stream blocked forever 3.6.0 · Issue #3246 · square/okhttp · GitHub</a></li>
  <li><a href="https://github.com/square/okhttp/issues/4241" rel="nofollow noreferrer">Sometime may block · Issue #4241 · square/okhttp · GitHub</a></li>
  </ul>
  <p>OkHttp3 source code:</p>
  <pre class="lang-java prettyprint-override"><code>/**
   * Like {@link #wait}, but throws an {@code InterruptedIOException} when interrupted instead of
   * the more awkward {@link InterruptedException}.
   */
  void waitForIo() throws InterruptedIOException {
    try {
      wait();
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt(); // Retain interrupted status.
      throw new InterruptedIOException();
    }
  }
  </code></pre>