Skip to content
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

HttpService cause http connection leak #710

Closed
ciferliu opened this issue Sep 17, 2018 · 5 comments
Closed

HttpService cause http connection leak #710

ciferliu opened this issue Sep 17, 2018 · 5 comments
Assignees
Labels
awaiting-pr Waiting for PR awaiting-user-input Require more info or input from user bug A bug in behaviour or functionality

Comments

@ciferliu
Copy link

ciferliu commented Sep 17, 2018

application log

okhttp3.OkHttpClient - A connection to http://localhost:8545/ 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);

==============
okhttp3 java doc
okhttp3.ResponseBody

A one-shot stream from the origin server to the client application with the raw bytes of the response body. Each response body is supported by an active connection to the webserver. This imposes both obligations and limits on the client application.

The response body must be closed.
Each response body is backed by a limited resource like a socket (live network responses) or an open file (for cached responses). Failing to close the response body will leak resources and may ultimately cause the application to slow down or crash.

@iikirilov iikirilov added bug A bug in behaviour or functionality awaiting-user-input Require more info or input from user labels Nov 9, 2018
@iikirilov
Copy link
Contributor

Please provide information to reproduce

@iikirilov iikirilov self-assigned this Nov 9, 2018
@antonydenyer
Copy link
Contributor

This is caused when an error is returned (okhttp throws an error if it's not 2xx) from the rpc endpoint.

square/okhttp#2311

antonydenyer added a commit to antonydenyer/web3j that referenced this issue Jun 4, 2019
antonydenyer added a commit to antonydenyer/web3j that referenced this issue Jun 4, 2019
antonydenyer added a commit to antonydenyer/web3j that referenced this issue Jun 4, 2019
@antonydenyer
Copy link
Contributor

This is still an open issue. The change I made didn't solve the issue and was reverted.

@iikirilov
Copy link
Contributor

This was auto-closed from the merge.

@andrii-kl
Copy link
Contributor

@ciferliu fixed in commit 6d5b2fe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-pr Waiting for PR awaiting-user-input Require more info or input from user bug A bug in behaviour or functionality
Projects
None yet
Development

No branches or pull requests

5 participants