Commit 9fdb3f29 authored by Michael Taufen's avatar Michael Taufen

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.
parent 2e989a3c
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment