]
Will Burns updated ISPN-12561:
------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
CacheV2ResourceTest does not close RestClient responses
-------------------------------------------------------
Key: ISPN-12561
URL:
https://issues.redhat.com/browse/ISPN-12561
Project: Infinispan
Issue Type: Bug
Components: REST, Test Suite
Affects Versions: 12.0.0.Dev07
Reporter: Dan Berindei
Assignee: Dan Berindei
Priority: Minor
Fix For: 12.0.0.CR1
{{RestClient}} needs responses with bodies to be closed, either explicitly, or implicitly
by reading the entire body. {{CacheV2ResourceTest}} checks only the HTTP status for most
responses, without reading the body.
OkHttpClient logs a WARN message when a response is not closed. If debug logging is
enabled for {{okhttp3.OkHttpClient}}, the message includes a stack trace:
{noformat}
10:22:36,569 WARN (OkHttp ConnectionPool) [OkHttpClient] A connection to
https://localhost:43483/ was leaked. Did you forget to close a response body?
java.lang.Throwable: response.body().close()
at okhttp3.internal.platform.Platform.getStackTraceForCloseable(Platform.java:149)
at okhttp3.internal.connection.Transmitter.callStart(Transmitter.java:116)
at okhttp3.RealCall.enqueue(RealCall.java:92)
at
org.infinispan.client.rest.impl.okhttp.RestClientOkHttp.execute(RestClientOkHttp.java:248)
at
org.infinispan.client.rest.impl.okhttp.RestCacheClientOkHttp.post(RestCacheClientOkHttp.java:94)
at
org.infinispan.rest.resources.CacheV2ResourceTest.testCacheV2KeyOps(CacheV2ResourceTest.java:142)
{noformat}