Http-lib doesn't close respone body?


#1

Once in a while we see these warnings in the log. One for each url we use

okt 22, 2018 12:53:01 PM okhttp3.internal.platform.Platform log
WARNING: A connection to https://xxx.xx/ was leaked. Did you forget to close a response body?
2018.10.22 12:53:01.221 WARN okhttp3.OkHttpClient - A connection to https://xxx.xx/ was leaked. Did you forget to close a response body?

Bug?


#2

Do you see any exceptions in the log while calling lib-http-client? Maybe some time before the warning.

What kind of requests are they, get or post?


#3

Hi again.
This was a bug. We have released a new version of the lib.
The only change is this bugfix. There are no breaking changes in this update, just update the lib-http-client in build.gradle and rebuild:

include 'com.enonic.lib:lib-http-client:1.0.4

Thanks for reporting it.
It would be nice if you can confirm that the warnings don’t appear in the logs after the fix.


#4

No exceptions. just a bunch of warnings group together. They are all GET requests.

We’ll keep an eye out for any errors after updating :slight_smile:


#5