-
Notifications
You must be signed in to change notification settings - Fork 729
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
WARNING [com.squareup.okhttp.OkHttpClient] (OkHttp ConnectionPool) A connection to https://api.github.com/ was leaked. Did you forget to close a response body? #997
Comments
@soul2zimate |
Great! looking forward to the next release. thanks. |
@soul2zimate If you want to help out, you could build the code from that PR and see if it works for your case. |
sure, I will build a 1.118-SNAPSHOT and test it at the local. |
Unfortunately, it still sporadically presents in log with the fix mentioned in your 1st comment. Does is also close the response body in case of unexpected IO exception from network lag? |
@soul2zimate
But can totally believe there is a path through all the obsolete code that gets a body and then doesn't close it. github-api/src/main/java/org/kohsuke/github/GitHubHttpUrlConnectionClient.java Lines 58 to 72 in c06c066
It is also possible that some part of your code is the cause - if the caller gets a stream and doesn't close it, the leak could still happen. Are you using any of the methods that return I'm laying blame just looking for possibilities. I thought we'd mostly closed the problem. |
@soul2zimate |
Because I need to use the conditional request against GitHub, I am using okhttp as pluggable HTTP client with okhttp-urlconnection version 2.7.5 The way I instantiate the |
OkHttp 2.x is unsupported. OkHttpUrlFactory contains bugs and limiations which will not be fixed and also cannot be mitigated by this library. Users should move to OkHttp3. Closes hub4j#997
OkHttp 2.x is unsupported. OkHttpUrlFactory contains bugs and limiations which will not be fixed and also cannot be mitigated by this library. Users should move to OkHttp3. Closes hub4j#997
@soul2zimate |
Thanks, I have tried with okhttp3, the warning seems gone. |
WARNING [com.squareup.okhttp.OkHttpClient] (OkHttp ConnectionPool) A connection to https://api.github.com/ was leaked. Did you forget to close a response body?
I am using version 1.116. I sometimes see this warning message in my server log, there is no real occurrence pattern. I am not sure why that happened, but it seems it relates to bad network connection.
In my code, I have a static GitHub instance and use it periodically to communicate with Github.
I can see similar message mentioned in a previous pull request #346 on Feb 23, 2017 trying to ignore the warning from okhttp.
Does this really a harmful messages ? How should I prevent this in github-api since I don't use okhttp directly.
Thank you.
The text was updated successfully, but these errors were encountered: