Skip to content

Add limited locking around the end of the call#6095

Merged
yschimke merged 1 commit intomasterfrom
jwilson.0528.concurrent_call_end
May 29, 2020
Merged

Add limited locking around the end of the call#6095
yschimke merged 1 commit intomasterfrom
jwilson.0528.concurrent_call_end

Conversation

@swankjesse
Copy link
Copy Markdown
Collaborator

This is mostly necessary because we have a possibility of duplex
calls.

@yschimke
Copy link
Copy Markdown
Collaborator

Test failures seem definitely related

okhttp3.URLConnectionTest > requestBodySurvivesRetriesWithFixedLength FAILED
    java.lang.IllegalStateException: cannot make a new request because the previous response is still open: please call response.close()
        at okhttp3.internal.connection.RealCall.enterNetworkInterceptorExchange(RealCall.kt:229)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:66)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
        at okhttp3.URLConnectionTest.getResponse(URLConnectionTest.java:3763)
        at okhttp3.URLConnectionTest.testRequestBodySurvivesRetries(URLConnectionTest.java:311)
        at okhttp3.URLConnectionTest.requestBodySurvivesRetriesWithFixedLength(URLConnectionTest.java:288)
okhttp3.URLConnectionTest > disconnectDuringConnect_cookieJar FAILED
    java.lang.IllegalStateException: cannot make a new request because the previous response is still open: please call response.close()
        at okhttp3.internal.connection.RealCall.enterNetworkInterceptorExchange(RealCall.kt:229)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:66)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
        at okhttp3.URLConnectionTest.disconnectDuringConnect_cookieJar(URLConnectionTest.java:1166)

This is mostly necessary because we have a possibility of duplex
calls.
@swankjesse swankjesse force-pushed the jwilson.0528.concurrent_call_end branch from d4fd871 to 8e979e7 Compare May 29, 2020 01:32
check(expectMoreExchanges) { "released" }
check(!responseBodyOpen)
check(!requestBodyOpen)
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, failures were my fault. I move the assignments on line 259 up here to save a synchronized block, and that was broken if the lines in-between throw! Argh!

I believe the update doesn’t have behavior changes, other than introduced locking.

@yschimke yschimke merged commit 930a8ae into master May 29, 2020
@yschimke yschimke deleted the jwilson.0528.concurrent_call_end branch May 29, 2020 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants