From b4ab2809500d2182f1a5373c1515eb30e146c9ab Mon Sep 17 00:00:00 2001 From: Mikhail Date: Sat, 29 Aug 2026 23:31:25 +0300 Subject: [PATCH] align cognitive readiness probe budgets --- cmd/core-runtime/main.go | 3 ++- deploy/docker-compose.prod.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/core-runtime/main.go b/cmd/core-runtime/main.go index 552e171..005da3b 100644 --- a/cmd/core-runtime/main.go +++ b/cmd/core-runtime/main.go @@ -154,13 +154,14 @@ func main() { } mux.Handle("/healthz", health.Handler{Runtime: "core-runtime", SemanticGeneration: 1, ArchitectureGeneration: 1}) readinessClient := &http.Client{Timeout: 2 * time.Second} + cognitiveReadinessClient := &http.Client{Timeout: 20 * time.Second} mux.Handle("/readyz", health.ReadinessHandler{Runtime: "core-runtime", Probes: []health.Probe{ health.TCPProbe("postgres", envOr("POSTGRES_HOST", "postgres"), envOr("POSTGRES_PORT", "5432")), health.HTTPProbe(readinessClient, strings.TrimRight(envOr("CONTINUITY_RUNTIME_URL", "http://continuity-runtime:8081"), "/")+"/healthz"), // A running worker is not necessarily ready to serve cognitive traffic. // Keep deterministic paths alive, but do not advertise overall readiness // while the cognitive dependency is still warming. - health.HTTPProbe(readinessClient, strings.TrimRight(envOr("COGNITIVE_RUNTIME_URL", "http://cognitive-worker:8083"), "/")+"/readyz"), + health.HTTPProbe(cognitiveReadinessClient, strings.TrimRight(envOr("COGNITIVE_RUNTIME_URL", "http://cognitive-worker:8083"), "/")+"/readyz"), }}) admissionPolicy := capability.AdmissionPolicy{ID: envOr("COGNITIVE_ADMISSION_POLICY_ID", "creator-advisory-local-v1"), MaxConcurrent: envInt("COGNITIVE_ADMISSION_MAX_CONCURRENT", 1), MaxAcceptedPerHour: envInt("COGNITIVE_ADMISSION_MAX_ACCEPTED_PER_HOUR", 60), MaxInputBytes: envInt("COGNITIVE_ADMISSION_MAX_INPUT_BYTES", 80<<10), MaxOutputBytes: envInt("COGNITIVE_ADMISSION_MAX_OUTPUT_BYTES", 16<<10)} mux.HandleFunc("POST /v1/internal/cognitive/admission", func(w http.ResponseWriter, r *http.Request) { diff --git a/deploy/docker-compose.prod.yml b/deploy/docker-compose.prod.yml index 292ad27..f2e8858 100644 --- a/deploy/docker-compose.prod.yml +++ b/deploy/docker-compose.prod.yml @@ -267,7 +267,7 @@ services: healthcheck: test: ["CMD-SHELL", "wget -qO- http://localhost:8083/healthz >/dev/null && wget -qO- http://localhost:8083/readyz >/dev/null"] interval: 10s - timeout: 5s + timeout: 20s retries: 20 cognitive-lifeboat: