I'm using your snowplow-java-tracker:0.8.2 and I have a following issue occuring:
WARN [OkHttp ConnectionPool][][] c.s.o.OkHttpClient 305: A connection to <my_url> was leaked. Did you forget to close a response body?
After debugging it I saw that your code is calling AbstractHttpClientAdapter.post(SelfDescribingJson payload) which calls OkHttpClientAdapter.doPost(String url, String payload) which calls com.squareup.okhttp.Call.execute() and documentation for this method says:
The caller may read the response body with the response's
- {Link (@link) Response#body} method. To facilitate connection recycling, callers
- should always {Link (@link) ResponseBody#close() close the response body}.
and you're not doing it in your library. OkHttpClientAdapter.doPost(String url, String payload) returns response code and never closes response body. Reading other resources it seems that the warning I get is exactly the consequence of not closing it
Did I get something wrong here, or it's a bug?
I'm using your snowplow-java-tracker:0.8.2 and I have a following issue occuring:
After debugging it I saw that your code is calling AbstractHttpClientAdapter.post(SelfDescribingJson payload) which calls OkHttpClientAdapter.doPost(String url, String payload) which calls com.squareup.okhttp.Call.execute() and documentation for this method says:
and you're not doing it in your library. OkHttpClientAdapter.doPost(String url, String payload) returns response code and never closes response body. Reading other resources it seems that the warning I get is exactly the consequence of not closing it
Did I get something wrong here, or it's a bug?