square/okhttp

ClassCastException: InterruptedIOException cannot be cast to Void

Closed this issue · 3 comments

I added a timeout to the crawler and ran it, and I got a surprising crash.

java.lang.ClassCastException: class java.io.InterruptedIOException cannot be cast to class java.lang.Void (java.io.InterruptedIOException and java.lang.Void are in module java.base of loader 'bootstrap')
	at okhttp3.internal.connection.Exchange$ResponseBodySource.close(Exchange.kt:347)
	at okio.RealBufferedSource.close(RealBufferedSource.kt:493)
	at okhttp3.internal._UtilCommonKt.closeQuietly(-UtilCommon.kt:284)
	at okhttp3.ResponseBody.close(ResponseBody.kt:195)
	at okhttp3.Response.close(Response.kt:343)
	at okhttp3.sample.Crawler.fetch(Crawler.java:138)
	at okhttp3.sample.Crawler.drainQueue(Crawler.java:81)
	at okhttp3.sample.Crawler.lambda$parallelDrainQueue$0(Crawler.java:62)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Can confirm this happens in the wild for us with OpenTelemetry calls.

Any timeline for the next release? :)

@neugartf it’s out!