question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connection leak on receiving the RateLimitException introduced in 1.9.0

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
j-m-xcommented, Nov 15, 2018

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

0reactions
lbalmacedacommented, Nov 30, 2018

Thanks! I’ve left you some suggestions but it looks good overall!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found