From 9daf97a9ab4eb6cdf71e4cc544066f7a4bc09f44 Mon Sep 17 00:00:00 2001 From: smruthi2187 <34555664+smruthi2187@users.noreply.github.com> Date: Tue, 3 Jul 2018 15:51:52 -0700 Subject: [PATCH] router tracks function liveness before forwarding request (#701) --- router/functionHandler.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/router/functionHandler.go b/router/functionHandler.go index 4c82ffb2..68763c69 100644 --- a/router/functionHandler.go +++ b/router/functionHandler.go @@ -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 }