|
@@ -68,6 +68,7 @@ func (p *reverseProxy) ServeHTTP(rw http.ResponseWriter, clientreq *http.Request
|
|
|
endpoints := p.director.endpoints()
|
|
endpoints := p.director.endpoints()
|
|
|
if len(endpoints) == 0 {
|
|
if len(endpoints) == 0 {
|
|
|
msg := "proxy: zero endpoints currently available"
|
|
msg := "proxy: zero endpoints currently available"
|
|
|
|
|
+ // TODO: limit the rate of the error logging.
|
|
|
log.Printf(msg)
|
|
log.Printf(msg)
|
|
|
e := httptypes.NewHTTPError(http.StatusServiceUnavailable, msg)
|
|
e := httptypes.NewHTTPError(http.StatusServiceUnavailable, msg)
|
|
|
e.WriteTo(rw)
|
|
e.WriteTo(rw)
|
|
@@ -91,6 +92,7 @@ func (p *reverseProxy) ServeHTTP(rw http.ResponseWriter, clientreq *http.Request
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if res == nil {
|
|
if res == nil {
|
|
|
|
|
+ // TODO: limit the rate of the error logging.
|
|
|
msg := fmt.Sprintf("proxy: unable to get response from %d endpoint(s)", len(endpoints))
|
|
msg := fmt.Sprintf("proxy: unable to get response from %d endpoint(s)", len(endpoints))
|
|
|
log.Printf(msg)
|
|
log.Printf(msg)
|
|
|
e := httptypes.NewHTTPError(http.StatusBadGateway, msg)
|
|
e := httptypes.NewHTTPError(http.StatusBadGateway, msg)
|