Skip to content

Connection leak on receiving the RateLimitException introduced in 1.9.0 #174

@j-m-x

Description

@j-m-x

The RateLimitException detection is working perfectly, but unfornately the current implementation forgets to close a response body, hence the following warning in the logs:

WARNING: A connection to https://<ommited>.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);

Simply moving the check on the 429 http status to inside the try-with-resources statement just below is enough to ensure the response body gets properly closed.

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

    Issue actions