Getting a lot of errors like this from: ```okhttp3...
# apollo-kotlin
r
Getting a lot of errors like this from:
Copy code
okhttp3.OkHttpClient - A connection to <https://example.com/> was leaked. Did you forget to close a response body?
I'm using 2.5.9, and apollo-runtime is the only user of okhttp3, except that I have
com.squareup.okhttp3:logging-interceptor
enabled. Is there anything in particular I should look for in my code that might be causing this?
m
Do you override
Callback.onHttpError
by any chance? This requires closing the
rawResponse
manually
r
Nope
m
I'll double check tomorrow but the regular
Callback.onResponse()
doesn't expose a body so that must be somewhere else
r
I do have query batching enabled. Other than that I'm not doing anything too unusual.
👀 1
m
Ah, batching could be a good candidate
Will do a release most likely next week, if that can wait until then?
r
Nice, thanks!
m
Also, out of curiosity, is there any drawbacks besides the error message or is OkHttp garbage collecting the responses enough to make the app work ok?
r
I had one case of postgresql running out of connections on the server but I don't know if it was related to this or not. The load is pretty low so its possible the GC is keeping ahead of the leak most of the time so far.
👍 1