Fix k8s API client timeout #606
No reviewers
Labels
No labels
API
Billing
UI/UX
dependencies
bug
change
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
servala/servala-portal!606
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/k8s-api-client-timeout-injection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The generated Kubernetes Python SDK always forwards _request_timeout (defaulting to None) as an explicit kwarg into ApiClient.call_api. ServalaApiClient checked "_request_timeout not in kwargs", so the K8S_TIMEOUT_DEFAULT=(5,10) default was never applied to any SDK call - every call ran with timeout=None (urllib3 blocking sockets, no timeout). A slow SOCKS5 proxy or unreachable K8s endpoint hung the gunicorn worker until --timeout 60 fired SIGABRT -> sys.exit(1) -> SystemExit(1) mid-recv_into, surfacing as the intermittent prod SystemExit trace. Fix: replace the absence check with kwargs.get("_request_timeout") is None so the default is injected on the SDK's explicit-None path. A read timeout now raises urllib3 HTTPError (already in K8S_TRANSPORT_ERRORS), which kubernetes_object catches and degrades to None + a warning. Adds a parametrized regression test covering both the no-kwarg and the SDK-style _request_timeout=None paths.WIP: fix/k8s-api-client-timeout-injectionto Fix k8s API client timeout