Fix k8s API client timeout #606

Merged
tobru merged 1 commit from fix/k8s-api-client-timeout-injection into main 2026-07-09 14:37:48 +00:00
Owner
No description provided.
allow to copy prod db
Some checks failed
Build and Deploy Staging / build (push) Has been cancelled
Build and Deploy Staging / deploy-appuio (push) Has been cancelled
7a54ffbced
fix(k8s): inject default timeout when SDK passes _request_timeout=None
All checks were successful
Tests / test (push) Successful in 1m27s
7f72549a54
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.
tobru changed title from WIP: fix/k8s-api-client-timeout-injection to Fix k8s API client timeout 2026-07-09 14:37:38 +00:00
tobru merged commit 1337e01870 into main 2026-07-09 14:37:48 +00:00
tobru deleted branch fix/k8s-api-client-timeout-injection 2026-07-09 14:37:49 +00:00
Sign in to join this conversation.
No description provided.