From 7e8506583288ca65f16a38ed4bf4591fcaea6776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BE=84=E6=BD=AD?= Date: Sun, 4 Feb 2024 18:52:14 +0800 Subject: [PATCH] increase health check timeout (#820) --- Makefile.core.mk | 4 ++-- ...0240204-increase-healthcheck-timeout.patch | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 istio/1.12/patches/istio/20240204-increase-healthcheck-timeout.patch diff --git a/Makefile.core.mk b/Makefile.core.mk index 34ca1f4140..a806c876a4 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -154,13 +154,13 @@ build-pilot-local: build-gateway: prebuild external/package/envoy-amd64.tar.gz external/package/envoy-arm64.tar.gz build-pilot cd external/istio; BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=true DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.proxyv2" make docker -build-gateway-local: prebuild external/package/envoy-amd64.tar.gz external/package/envoy-arm64.tar.gz build-pilot +build-gateway-local: prebuild external/package/envoy-amd64.tar.gz external/package/envoy-arm64.tar.gz cd external/istio; rm -rf out/linux_${GOARCH_LOCAL}; GOOS_LOCAL=linux TARGET_OS=linux BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=false DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.proxyv2" make docker build-istio: prebuild build-pilot cd external/istio; BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=true DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.pilot" make docker -build-istio-local: prebuild build-pilot-local +build-istio-local: prebuild cd external/istio; rm -rf out/linux_${GOARCH_LOCAL}; GOOS_LOCAL=linux TARGET_OS=linux BUILD_WITH_CONTAINER=1 BUILDX_PLATFORM=false DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.pilot" make docker build-wasmplugins: diff --git a/istio/1.12/patches/istio/20240204-increase-healthcheck-timeout.patch b/istio/1.12/patches/istio/20240204-increase-healthcheck-timeout.patch new file mode 100644 index 0000000000..ff31b1f0bd --- /dev/null +++ b/istio/1.12/patches/istio/20240204-increase-healthcheck-timeout.patch @@ -0,0 +1,21 @@ +diff -Naur istio/pilot/cmd/pilot-agent/status/util/stats.go istio-new/pilot/cmd/pilot-agent/status/util/stats.go +--- istio/pilot/cmd/pilot-agent/status/util/stats.go 2024-02-04 18:48:18.000000000 +0800 ++++ istio-new/pilot/cmd/pilot-agent/status/util/stats.go 2024-02-04 09:35:42.000000000 +0800 +@@ -37,7 +37,7 @@ + updateStatsRegex = "^(cluster_manager\\.cds|listener_manager\\.lds)\\.(update_success|update_rejected)$" + ) + +-var readinessTimeout = time.Second * 3 // Default Readiness timeout. It is set the same in helm charts. ++var readinessTimeout = time.Second * 60 // Default Readiness timeout. It is set the same in helm charts. + + type stat struct { + name string +@@ -105,7 +105,7 @@ + localHostAddr = "localhost" + } + +- stats, err := http.DoHTTPGet(fmt.Sprintf("http://%s:%d/stats?usedonly", localHostAddr, adminPort)) ++ stats, err := http.DoHTTPGetWithTimeout(fmt.Sprintf("http://%s:%d/stats?usedonly", localHostAddr, adminPort), readinessTimeout) + if err != nil { + return nil, err + }