Unexpected connection leak message in 3.0.0-RC1
See original GitHub issueI’m using the published 3.0.0-RC1.
I’m seeing this message:
WARNING: A connection to https://api.push.apple.com/ was leaked. Did you forget to close a response body?
Jan 08, 2016 8:23:58 PM okhttp3.ConnectionPool pruneAndGetAllocationCount
Over and over.
My code looks like this:
client.newCall(request).enqueue(new Callback() {
override def onFailure(request: Request, throwable: IOException) {
}
override def onResponse(response: Response) {
if (!response.isSuccessful()) {
val body = response.body()
val charStream = body.charStream()
val reason = GSON.fromJson(charStream, classOf[APNSError])
body.close()
}
}
})
(Note that the example Gson recipe leaks the body there, but this doesn’t.)
Do I need to close the body in the successful case even if I’m not reading it?
Thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Release Notes for Zabbix 3.0.0rc1
This document contains the release notes for Zabbix 3.0.0rc1. ... ZBX-9895, Fixed memory leak in case of unsupported field type while ...
Read more >Apparent connection leak detected with Hikari CP
You're using a recent version of Hikari CP and the connection leak resolves by itself (as visible in your logs). As noted by...
Read more >3.x Change Log - OkHttp
Fix: Provide actionable advice when the exchange is non-null. Prior to 3.14, OkHttp would silently leak connections when an interceptor retries without closing ......
Read more >Apache Log4j Security Vulnerabilities
Apache Log4j Security Vulnerabilities. This page lists all the security vulnerabilities fixed in released versions of Apache Log4j 2.
Read more >uamqp · PyPI
Fixed memory leak in win32 socketio and tlsio (azure-sdk-for-python issue #19777). ... Added support for AMQP Sequence as the body type of an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright – I think the docs could be clearer here. 😃
None of these https://github.com/square/okhttp/wiki/Recipes call close.
Retrofit closes it for you
On Sat, Jun 10, 2017 at 6:55 PM Etienne Lawlor notifications@github.com wrote: