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

okhttp3.OkHttpClient - A connection was leaked. Did you forget to close a response body? #3813

Closed
swartzkevinPFG opened this issue Nov 2, 2021 · 3 comments · Fixed by #3814

Comments

@swartzkevinPFG
Copy link

We are using the OpenTelemetry Java Agent 1.7.1. We are continually getting the below warning when our spans are exported to our collector. Is there any way to determine what is causing this warning? When we run the agent in debug mode, we do not get any additional details of root cause. This issue consumes all available threads until we stop the process to reclaim them.

[otel.javaagent 2021-11-01 20:04:28:616 -0500] [OkHttp ConnectionPool] WARN okhttp3.OkHttpClient - A connection to https://somehost.com:9999/ was leaked. Did you forget to close a response body?
java.lang.Throwable: response.body().close()
at okhttp3.internal.platform.Platform.getStackTraceForCloseable(Platform.java:149)
at okhttp3.internal.connection.Transmitter.callStart(Transmitter.java:116)
at okhttp3.RealCall.enqueue(RealCall.java:92)
at io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter.export(OtlpHttpSpanExporter.java:107)
at io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.exportCurrentBatch(BatchSpanProcessor.java:305)
at io.opentelemetry.sdk.trace.export.BatchSpanProcessor$Worker.run(BatchSpanProcessor.java:222)
at java.base/java.lang.Thread.run(Unknown Source)

@trask
Copy link
Member

trask commented Nov 2, 2021

@swartzkevinPFG thanks for reporting this!

@anuraaga do you want to transfer this to the SDK repo, or triage it here?

@anuraaga anuraaga transferred this issue from open-telemetry/opentelemetry-java-instrumentation Nov 2, 2021
@swartzkevinPFG
Copy link
Author

swartzkevinPFG commented Nov 3, 2021

Thanks for your help on this @anuraaga and @trask. Please let me know if you need anything further on this. We are continuing to try to track http traffic to see if it is something with our Java application or the Collector may be returning a bad http response code that could be contributing to this, but we still think that SDK should handle it more gracefully if possible. We will watch #3814 for updates.

@swartzkevinPFG
Copy link
Author

The patch for this issue has been provided in v1.7.2. Thanks for your help.

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 a pull request may close this issue.

2 participants