Connection leak on receiving the RateLimitException introduced in 1.9.0
See original GitHub issueThe 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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
java.lang.Exception: Apparent connection leak detected Error
The reason for this error is that the connection from the connection pool timed out, which triggered the connection leak detection.
Read more >Preventing database connection leaks - Etleap Blog
Today I am going to write about database connection leaks. ... Fortunately, HikariCP has a built-in connection leak detection mechanism, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@lbalmaceda
Thanks for your reply and taking the time to investigate this issue. I agree with you that my current PR is a little crude, I will improve it based on your suggestions, most likely sometime next week.
Thanks! I’ve left you some suggestions but it looks good overall!