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

OkHttpClient - A connection to [issuer] was leaked #42

Closed
shiloa opened this issue Feb 27, 2017 · 6 comments
Closed

OkHttpClient - A connection to [issuer] was leaked #42

shiloa opened this issue Feb 27, 2017 · 6 comments

Comments

@shiloa
Copy link

shiloa commented Feb 27, 2017

Hi,

We're using com.auth0:auth0:1.0.0 and com.auth0:auth0-spring-security-api:1.0.0-rc2 inside a spring-boot 1.5.1.RELEASE application. When calling the Auth0 API, we occasionally see a log warning that apparently emanates from okhttp3:

2017-02-27T08:05:05.453 WARN  okhttp3.OkHttpClient - A connection to https://[our-issuer-id].auth0.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);

Looking it up it seems the possible cause is that the body of the request needs to be explicitly closed when the response code is not 200. See square/okhttp#2311.

Thanks!

@lbalmaceda
Copy link
Contributor

Hi @shiloa,
We fixed that in #38. You'll see it in the next release.

Cheers,

@shiloa
Copy link
Author

shiloa commented Feb 27, 2017

thanks @lbalmaceda.

@lbalmaceda lbalmaceda added this to the v1-Next milestone Mar 15, 2017
@lbalmaceda lbalmaceda modified the milestones: v1-Next, 1.1.0 May 23, 2017
@AlphaJuliettOmega
Copy link

@lbalmaceda how do I know if there was a regression on this issue or if it's a new issue?

I don't know how to reproduce or get more info but I'm seeing this in my logging:

W/okhttp.OkHttpClient: A connection to http://10.0.2.2:8081/ 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);

And I can't find much about this anywhere else (I'm using React-native-intercom 18, upgrade to 19 didn't change it)

@lbalmaceda
Copy link
Contributor

I'm not sure. Since then, we wrapped the access to the response body both when parsing a 2xx (here) or an error response (here). With what version of the Auth0-Java SDK are you seeing this?

@benwaffle
Copy link

I am also seeing this in 1.29.0

@lbalmaceda
Copy link
Contributor

@benwaffle can you share steps to reproduce this? any other detail that can help us understand your usage?

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

No branches or pull requests

4 participants