Skip to content

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

Closed
@shiloa

Description

@shiloa

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!

Activity

lbalmaceda

lbalmaceda commented on Feb 27, 2017

@lbalmaceda
Contributor

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

Cheers,

shiloa

shiloa commented on Feb 27, 2017

@shiloa
Author

thanks @lbalmaceda.

added this to the v1-Next milestone on Mar 15, 2017
modified the milestones: v1-Next, 1.1.0 on May 23, 2017
AlphaJuliettOmega

AlphaJuliettOmega commented on Apr 19, 2021

@AlphaJuliettOmega

@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

lbalmaceda commented on Apr 19, 2021

@lbalmaceda
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

benwaffle commented on May 10, 2021

@benwaffle

I am also seeing this in 1.29.0

lbalmaceda

lbalmaceda commented on May 11, 2021

@lbalmaceda
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @shiloa@benwaffle@lbalmaceda@AlphaJuliettOmega

        Issue actions

          OkHttpClient - A connection to [issuer] was leaked · Issue #42 · auth0/auth0-java