okhttp icon indicating copy to clipboard operation
okhttp copied to clipboard

java.lang.IllegalStateException: closed

Open vivelvlv opened this issue 8 years ago • 3 comments

FATAL EXCEPTION: OkHttp Dispatcher Process: com.ting.kidknowledge, PID: 19470 java.lang.IllegalStateException: closed at okio.RealBufferedSink.write(RealBufferedSink.java:39) at okio.ForwardingSink.write(ForwardingSink.java:35) at com.ting.android.data.http.impl.body.ProgressRequestBody$1.write(ProgressRequestBody.java:51) at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171) at okio.RealBufferedSink.writeAll(RealBufferedSink.java:99) at okhttp3.RequestBody$3.writeTo(RequestBody.java:120) at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.java:173) at okhttp3.MultipartBody.writeTo(MultipartBody.java:114) at com.ting.android.data.http.impl.body.ProgressRequestBody.writeTo(ProgressRequestBody.java:40) at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:72) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.ting.android.data.http.impl.interceptors.SetCookieInterceptor.intercept(SetCookieInterceptor.java:29) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

at okhttp 3.9.1 version, at bad reliability (10%) net work(can simulate by charles), and try to upload more pictures such as 3~9 pics,can produce this crash

vivelvlv avatar Feb 12 '18 08:02 vivelvlv

the same with https://github.com/square/okhttp/issues/3319

vivelvlv avatar Feb 12 '18 08:02 vivelvlv

My guess is that ProgressRequestBody is to blame.

swankjesse avatar Feb 12 '18 11:02 swankjesse

I set writeTo(sink) under try catch, solve this problem now, tks

vivelvlv avatar Feb 13 '18 01:02 vivelvlv