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.
pull/6/head
Michael Taufen 2016-08-23 16:48:01 -07:00
parent 2e989a3c38
commit 9fdb3f291a
1 changed files with 2 additions and 2 deletions

View File

@ -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
}