Merged
Conversation
The global Chi middleware.Timeout(60s) was canceling workload create requests before the image pull could complete, causing intermittent HTTP 500 errors in CI when images weren't cached. Replace the global timeout with per-route timeouts: workload create and edit routes get an 11-minute timeout (slightly longer than the 10-minute imageRetrievalTimeout), while all other routes keep the standard 60-second timeout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4106 +/- ##
=======================================
Coverage 68.68% 68.69%
=======================================
Files 453 453
Lines 46011 46013 +2
=======================================
+ Hits 31604 31608 +4
+ Misses 11967 11965 -2
Partials 2440 2440 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rdimitrov
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
middleware.Timeout(60s)cancels the request context before container image pulls can complete. When images are cached the pull finishes in <60s (pass); when uncached it takes >60s (HTTP 500).imageRetrievalTimeout), while all other routes keep the standard 60-second timeout.Type of change
Test plan
task test)task lint-fix)Changes
pkg/api/server.gomiddleware.Timeoutfromr.Use()block; apply standard timeout per-mount insetupDefaultRoutesfor all non-workload routerspkg/api/v1/workloads.gor.With(): 11min for create/edit (image pulls), 60s for all other routesSpecial notes for reviewers
longRunningRouteTimeoutis derived fromimageRetrievalTimeout + 1*time.Minute(same package) so the invariant is maintained if the image timeout changes.WithRouteare not currently used anywhere, but now have a comment noting callers are responsible for their own timeout management.pkg/secretsandpkg/transport/proxy/transparentare unrelated to this change.Generated with Claude Code