<#1296 Network/handle deadline exceeded> Pull requ...
# flyte-github
a
#1296 Network/handle deadline exceeded Pull request opened by wild-endeavor Background 19-hour customer run died because of 11 consecutive child-launch
Enqueue
time outs at their 5s deadline, exhausting the controller's ~2-minute retry budget; the platform-level retry kicked in but took many hours to catch back up. The control plane was healthy the whole time, the same org was successfully enqueuing from other pods. The failing pod's pooled HTTP/2 connection had been silently black-holed (severed NAT/conntrack flow: packets vanish, no RST). The kernel by default doesn't declare such a socket dead for ~15 minutes, and the pool kept multiplexing every retry onto it - so no retry count could have saved the run. Prior art: Kubernetes maybe experienced a similar issue with kubelet↔️apiserver heartbeats (kubernetes#48638) and converged on two mitigations (#63492, #95981). Changes 1. Launch retry budget 10 → 100. Backoff is capped at 10s, so this rides out ~20 minutes of transient failure instead of ~2 — longer than a control-plane rollout, and longer than the kernel needs to kill a dead socket. Also clamp the backoff exponent so a large
_F_MAX_RETRIES
can't overflow. 2. Replace the connection pool after 3 consecutive deadline timeouts. The state/queue/actions clients now share one swappable HTTP-client facade; three straight `DEADLINE_EXCEEDED`s install a fresh client behind it, so the next retry opens a new TCP connection instead of riding the dead one. Any response from the server — even an error — proves the connection alive and resets the streak. The facade exists to avoid touching connectrpc internals (it goes in via the public
http_client
constructor arg); in-flight requests and streams keep the old client alive until they finish; informers share the same service objects, so the swap covers their reconnects automatically. Should also use HTTP/2 keepalive PINGs at the transport, the grpc client had this but pyqwest doesn't. Testing Run a long running parent task, and then attach a network capable container to the pod Testing resetting with a new http client
Copy code
kubectl debug -it <pod> -n <ns> --image=nicolaka/netshoot --profile=netadmin -- bash
Inside that
Copy code
ss -tn state established '( dport = :443 )'   # to find the local port, 43782
iptables -I OUTPUT 1 -p tcp --sport 43782 -j DROP
use
dig +short <host>
to figure out the relevant IPs. After multiple failures the connection should be recycled and a new connection used.
Copy code
Jul 15 14:14:27.971 [flyte] ERROR Failed to launch action: 337bsrx8w3igt0a3ijcy5flit, Code: Code.DEADLINE_EXCEEDED, Details Request timed out backing off...
Jul 15 14:14:27.971 [flyte] WARNING [worker-6] Backing off for 0.5 [retry 1/100] on action 337bsrx8w3igt0a3ijcy5flit due to error: Failed to launch action: Request timed out
Jul 15 14:14:28.472 [flyte] WARNING [worker-6] Retrying action 337bsrx8w3igt0a3ijcy5flit after backoff
Jul 15 14:14:33.477 [flyte] ERROR Failed to launch action: 337bsrx8w3igt0a3ijcy5flit, Code: Code.DEADLINE_EXCEEDED, Details Request timed out backing off...
Jul 15 14:14:33.478 [flyte] WARNING [worker-6] Backing off for 1.0 [retry 2/100] on action 337bsrx8w3igt0a3ijcy5flit due to error: Failed to launch action: Request timed out
Jul 15 14:14:34.479 [flyte] WARNING [worker-6] Retrying action 337bsrx8w3igt0a3ijcy5flit after backoff
Jul 15 14:14:39.484 [flyte] WARNING 3 consecutive launch timeouts; replacing the HTTP connection pool in case the pooled connection is dead.
Testing full network partition Same setup as before then
Copy code
CP_IPS=$(dig +short dogfood.cloud-staging.union.ai)
for ip in $CP_IPS; do iptables -I OUTPUT 1 -d $ip -j DROP && echo "BLOCKED $ip"; done
should see messages like
Copy code
[ulh9sxvs9whsmgx5l8qx][a0] [flyte] WARNING Watch for ulh9sxvs9whsmgx5l8qx.a0 failed, retrying in 30.0 seconds...
[flyte] WARNING [worker-0] Retrying action ayj9zzqmhjkpp26o2dkkj4cdy after backoff
[flyte] ERROR Failed to launch action: ayj9zzqmhjkpp26o2dkkj4cdy, Code: Code.DEADLINE_EXCEEDED, Details Request timed out backing off...
[flyte] WARNING [worker-0] Backing off for 10.0 [retry 44/100] on action ayj9zzqmhjkpp26o2dkkj4cdy due to error: Failed to launch action: Request timed out
[flyte] WARNING [worker-0] Retrying action ayj9zzqmhjkpp26o2dkkj4cdy after backoff
[flyte] WARNING 3 consecutive launch timeouts; replacing the HTTP connection pool in case the pooled connection is dead.
[flyte] ERROR Failed to launch action: ayj9zzqmhjkpp26o2dkkj4cdy, Code: Code.DEADLINE_EXCEEDED, Details Request timed out backing off...
[flyte] WARNING [worker-0] Backing off for 10.0 [retry 45/100] on action ayj9zzqmhjkpp26o2dkkj4cdy due to error: Failed to launch action: Request timed out
then
Copy code
for ip in $CP_IPS; do iptables -D OUTPUT -d $ip -j DROP && echo "UNBLOCKED $ip"; done
flyteorg/flyte-sdk