-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalStateException: released #2198
Comments
Definitely a bug in OkHttp, but nothing I could spot within a few minutes of staring at the code. I’ll try to reproduce and get this fixed. |
This may or may not be related, I get the IllegalStateException with this scenario. I'm not 100% sure if this is considered valid @Test public void cachedRedirect() throws IOException {
server.enqueue(new MockResponse()
.setResponseCode(HttpURLConnection.HTTP_MOVED_PERM)
.addHeader("Cache-Control: max-age=60")
.addHeader("Location: /bar"));
server.enqueue(new MockResponse()
.setBody("ABC"));
server.enqueue(new MockResponse()
.setBody("ABC"));
Request request1 = new Request.Builder().url(server.url("/foo")).build();
Response response1 = client.newCall(request1).execute();
assertEquals("ABC", response1.body().string());
Request request2 = new Request.Builder().url(server.url("/foo")).build();
Response response2 = client.newCall(request2).execute();
assertEquals("ABC", response2.body().string());
} |
@dave-r12 ooh, awesome test. Thankyou |
We might still need them to handle a redirect. Closes: #2198
Is there any plan to release another bug fix to the 2.x branch or will this only be in 3.0? |
Can do. #2209 |
We might still need them to handle a redirect. Closes: #2198
java.lang.IllegalStateException: released
I'm getting this sporadically during long monkey test runs, we do lots of connection cancellation during these runs, so could be related to that maybe? Any insight into what might lead to this? The stack is entirely inside OkHttp code so not much to go on here.
// java.lang.IllegalStateException: released // at com.squareup.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:142) // at com.squareup.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126) // at com.squareup.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95) // at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:283) // at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224) // at com.squareup.okhttp.Call.getResponse(Call.java:286) // at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:243) // at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205) // at com.squareup.okhttp.Call.access$100(Call.java:35) // at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:171) // at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33) // at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) // at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) // at java.lang.Thread.run(Thread.java:856)
The text was updated successfully, but these errors were encountered: