router tracks function liveness before forwarding request (#701)

This commit is contained in:
smruthi2187
2018-07-03 15:51:52 -07:00
committed by GitHub
parent 032d1a8b9a
commit 9daf97a9ab
+5 -5
View File
@@ -155,6 +155,11 @@ func (roundTripper RetryingRoundTripper) RoundTrip(req *http.Request) (resp *htt
overhead := time.Since(startTime)
// tapService before invoking roundTrip for the serviceUrl
if !serviceUrlFromExecutor {
go roundTripper.funcHandler.tapService(serviceUrl)
}
// forward the request to the function service
resp, err = transport.RoundTrip(req)
if err == nil {
@@ -165,11 +170,6 @@ func (roundTripper RetryingRoundTripper) RoundTrip(req *http.Request) (resp *htt
functionCallCompleted(funcMetricLabels, httpMetricLabels,
overhead, time.Since(startTime), resp.ContentLength)
// if transport.RoundTrip succeeds and it was a cached entry, then tapService
if !serviceUrlFromExecutor {
go roundTripper.funcHandler.tapService(serviceUrl)
}
// return response back to user
return resp, nil
}