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

Leaking okhttp3.OkHttpClient connections #263

Closed
kingslef opened this issue Nov 3, 2020 · 1 comment · Fixed by lightstep/lightstep-metrics-java#20
Closed

Leaking okhttp3.OkHttpClient connections #263

kingslef opened this issue Nov 3, 2020 · 1 comment · Fixed by lightstep/lightstep-metrics-java#20
Assignees

Comments

@kingslef
Copy link

kingslef commented Nov 3, 2020

Occasionally (quite rarely) I'm seeing the following log:

okhttp3.OkHttpClient - A connection to https://ingest.lightstep.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

I'm using lightstep-tracer-jre version 0.30.1 and GRPC.


I'm not setting the URL anywhere in my application, so by the looks of it, it must be the default metrics URL. I haven't been able to reproduce it easily, but looking at the code, I noticed this. It looks like the the response.body is never closed, even though instructed by OkHttp (see e.g. square/okhttp#2311). It is definitely not closed if the response is not 200, but also the parseFrom seems to leave it open.

Or am I missing something?

@kingslef
Copy link
Author

These disappeared after upgrading 0.30.3. Thanks!

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