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

CacheV2ResourceTest does not close RestClient responses

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 12.0.0.CR1
    • 12.0.0.Dev07
    • REST, Test Suite
    • None

    Description

      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)
      

      Attachments

        Activity

          People

            dberinde@redhat.com Dan Berindei (Inactive)
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: