From 9fdb3f291a14db9e7292a7edaae69786ba1a64ba Mon Sep 17 00:00:00 2001 From: Michael Taufen Date: Tue, 23 Aug 2016 16:48:01 -0700 Subject: [PATCH] Stop fd leak in e2e_service.go Previously this code used http.Get and failed to read/close resp.Body, which prevented network connection reuse, leaking fds. Now we use http.Head instead, because its response always has a nil Body, so we don't have to worry about read/close. --- test/e2e_node/e2e_service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e_node/e2e_service.go b/test/e2e_node/e2e_service.go index b45e86bbd01..a2adc4e632f 100644 --- a/test/e2e_node/e2e_service.go +++ b/test/e2e_node/e2e_service.go @@ -483,7 +483,7 @@ func readinessCheck(urls []string, errCh <-chan error) error { case <-time.After(time.Second): ready := true for _, url := range urls { - resp, err := http.Get(url) + resp, err := http.Head(url) if err != nil || resp.StatusCode != http.StatusOK { ready = false break @@ -580,7 +580,7 @@ func (s *server) start() error { return case <-time.After(time.Second): for _, url := range s.healthCheckUrls { - resp, err := http.Get(url) + resp, err := http.Head(url) if err != nil || resp.StatusCode != http.StatusOK { break stillAlive }