Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12561

CacheV2ResourceTest does not close RestClient responses

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 12.0.0.Final
    • 12.0.0.Final
    • REST, Test Suite
    • None

      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:

      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)
      

              dberinde@redhat.com Dan Berindei (Inactive)
              dberinde@redhat.com Dan Berindei (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: