dockerize icon indicating copy to clipboard operation
dockerize copied to clipboard

Close connections

Open fujiwara opened this issue 2 years ago • 2 comments

Hi. This PR enables close test connections and HTTP response.

dockerize keeps a test TCP connection while running, but if the server cannot accept multiple TCP connections, the test connection fills the server's slot. It should be closed.

dockerize does not read HTTP response body and does not close it now. When an unread response body exists, http.Client cannot reuse the TCP connection for the next request.

fujiwara avatar Aug 04 '21 07:08 fujiwara

  1. If close the body without reading, the http.Client cannot reuse the TCP connection.
  2. When client.Do() returns error, resp.Body may be nil. Calling Close() raise a panic.

fujiwara avatar Sep 10 '21 00:09 fujiwara

Thanks, TIL 😊

ruudk avatar Sep 10 '21 06:09 ruudk