`okhttp3.internal.Util.closeQuietly` isn't that quite
See original GitHub issueIt seems that an issue with the underlying buffer / connection may lead to an Exception
(or even Error
!) thrown from close
method of the response. An example:
java.lang.AssertionError: java.io.EOFException
at okio.Buffer.clear(Buffer.java:932)
at okio.RealBufferedSource.close(RealBufferedSource.java:477)
at okhttp3.internal.Util.closeQuietly(Util.java:139)
What surprised us is Util.closeQuietly
in the stacktrace.
Isn’t it supposed to catch such errors and e.g. log instead of re-throwing?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Fatal - Interface not implemented - OkHttp3 - Android
I am requesting a JSON file with OkHttp3, RetroFit 2.0 + RxObservable and it throws Interface not implemented. This appears to only happen...
Read more >okhttp3.internal.Util.closeQuietly java code examples - Tabnine
Returns an immutable list containing elements. verifyAsIpAddress. Returns true if host is not a host name and might be an IP address. discard....
Read more >okhttp/src/main/java/com/squareup/okhttp/Connection.java
Source;. import static com.squareup.okhttp.internal.Util.closeQuietly; ... which isn't so much a connection as a single request/response exchange.
Read more >`NullPointerException: bio == null` from `NativeCrypto ...
Util.closeQuietly(Util.kt:501) at okhttp3.internal.connection. ... This crash is not exclusive to Pixel devices - we have seen occurrences ...
Read more >Invalid Azure URL or Personal Access Token for ALM Integration
No, the SonarQube user does not matter, only the PAT you use. ... Util.closeQuietly(Util.kt:498) at okhttp3.internal.connection.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, probably two questions to answer
https://twitter.com/bsideup/status/1273169998018752512
This particular crash is caused by unsafe concurrent access to a Buffer. Perhaps one code path is calling close() while another code path is attempting to read? Okio streams are not safe for concurrent use, and calling close() while another thread is reading or writing is unsupported.
The word quietly in this context is intended to hide IOExceptions only. The AssertionError here is an invariant being violated, and I don’t think it makes sense to attempt to recover from unexpected crashes.