Skip to content
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

Close response body of http connection #59

Merged
merged 2 commits into from
Apr 18, 2024
Merged

Conversation

pfeuffer
Copy link
Contributor

@pfeuffer pfeuffer commented Apr 17, 2024

Closing the body is necessary in okhttp, because the body is
backed by the socket. Without this, we get exceptions like
the following:

Apr 12, 2024 1:08:10 AM WARNING okhttp3.internal.platform.Platform log
A connection to https://atlas002.cloud.itz.in.bund.de/ was leaked. Did you forget to close a response body?
java.lang.Throwable: response.body().close()
at okhttp3.internal.platform.Platform.getStackTraceForCloseable(Platform.kt:145)
at okhttp3.internal.connection.RealCall.callStart(RealCall.kt:170)
at okhttp3.internal.connection.RealCall.enqueue(RealCall.kt:163)
at com.cloudogu.scmmanager.scm.api.ApiClient.execute(ApiClient.java:38)
at com.cloudogu.scmmanager.scm.api.HttpApiClient.get(HttpApiClient.java:60)
at com.cloudogu.scmmanager.scm.api.ScmManagerApi.getFileObject(ScmManagerApi.java:217)

@pfeuffer pfeuffer merged commit c5389a1 into master Apr 18, 2024
14 checks passed
@pfeuffer pfeuffer deleted the bugfix/close_body branch April 18, 2024 09: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.

1 participant