From be58b3e4fda6b77f27cccb19684c2d63bf148197 Mon Sep 17 00:00:00 2001 From: shaoyu Date: Wed, 6 May 2020 17:56:06 +0800 Subject: [PATCH] set idle timeout --- executor/api/rest/server.go | 6 ++++-- operator/controllers/seldondeployment_controller.go | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/executor/api/rest/server.go b/executor/api/rest/server.go index 5eef51aaf7..a642757e5c 100644 --- a/executor/api/rest/server.go +++ b/executor/api/rest/server.go @@ -20,6 +20,7 @@ import ( "net/http" "net/url" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" + "time" ) const ( @@ -74,8 +75,9 @@ func (r *SeldonRestApi) CreateHttpServer(port int) *http.Server { // will apply no timeout at all. Instead, we control that through the // http.Client instance making requests to the underlying node graph servers. return &http.Server{ - Handler: r.Router, - Addr: address, + Handler: r.Router, + Addr: address, + IdleTimeout: 65 * time.Second, } } diff --git a/operator/controllers/seldondeployment_controller.go b/operator/controllers/seldondeployment_controller.go index 060de55d98..28be15e181 100644 --- a/operator/controllers/seldondeployment_controller.go +++ b/operator/controllers/seldondeployment_controller.go @@ -243,6 +243,7 @@ func createIstioResources(mlDep *machinelearningv1.SeldonDeployment, }, }, }, + TrafficPolicy: &istio_networking.TrafficPolicy{ConnectionPool: &istio_networking.ConnectionPoolSettings{Http: &istio_networking.ConnectionPoolSettings_HTTPSettings{IdleTimeout: &types2.Duration{Seconds: 60}}}}, }, }