diff --git a/cmd/cognitive-worker/main.go b/cmd/cognitive-worker/main.go index b3a020c..554e2c9 100644 --- a/cmd/cognitive-worker/main.go +++ b/cmd/cognitive-worker/main.go @@ -71,7 +71,7 @@ func main() { if err != nil { log.Fatal(err) } - mediumTimeout := durationEnv("LOCAL_MEDIUM_PROVIDER_TIMEOUT", 60*time.Second) + mediumTimeout := durationEnv("LOCAL_MEDIUM_PROVIDER_TIMEOUT", 120*time.Second) mediumAdapter, adapterErr := models.NewOpenAICompatibleLocalAdapterWithAPIKeyAndTimeout(strings.TrimRight(mediumURL, "/"), mediumAPIKey, nil, mediumTimeout) if adapterErr != nil { log.Fatal(adapterErr) @@ -117,7 +117,7 @@ func main() { mux.Handle("/healthz", health.Handler{Runtime: "cognitive-worker", SemanticGeneration: 1, ArchitectureGeneration: 1}) readinessClient := &http.Client{Timeout: 2 * time.Second} cpuReadinessClient := &http.Client{Timeout: 10 * time.Second} - mediumReadinessTimeout := 60 * time.Second + mediumReadinessTimeout := 120 * time.Second mediumReadinessClient := &http.Client{Timeout: mediumReadinessTimeout} lifeboatURL := strings.TrimSuffix(strings.TrimRight(envOr("LOCAL_LIFEBOAT_PROVIDER_URL", "http://cognitive-lifeboat:8086/v1"), "/"), "/v1") + "/health" fleetClient := &http.Client{Timeout: 2 * time.Second} @@ -223,7 +223,7 @@ func refreshProviderDiscoveries(resolver bindingResolver, service discoveryServi for name := range service.providers { // Keep startup discovery bounded while allowing the authenticated local // gateway enough time to enumerate a loaded MEDIUM model. - ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) registration, ok := service.providers[name] if !ok || registration.Discovery == nil { cancel() diff --git a/cmd/core-runtime/main.go b/cmd/core-runtime/main.go index 9e1d0a1..5e006ce 100644 --- a/cmd/core-runtime/main.go +++ b/cmd/core-runtime/main.go @@ -154,10 +154,10 @@ 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: 70 * time.Second} + cognitiveReadinessClient := &http.Client{Timeout: 135 * time.Second} cognitiveReadinessProbe := health.HTTPProbe(cognitiveReadinessClient, strings.TrimRight(envOr("COGNITIVE_RUNTIME_URL", "http://cognitive-worker:8083"), "/")+"/readyz") - cognitiveReadinessProbe.Timeout = 70 * time.Second - mux.Handle("/readyz", health.ReadinessHandler{Runtime: "core-runtime", Timeout: 75 * time.Second, Probes: []health.Probe{ + cognitiveReadinessProbe.Timeout = 135 * time.Second + mux.Handle("/readyz", health.ReadinessHandler{Runtime: "core-runtime", Timeout: 140 * time.Second, 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.