Drain gateway connections without curl #1485
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 189 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.314
Real PR Conversation Timeline
1 comments
"Review active on #1485"
general
weight: 0.35
linkvt
The gateway's preStop hook calls curl, but the Envoy image doesn't include it. The hook sleeps without starting a drain, leaving keep-alive clients to discover closed connections at shutdown. We saw the same disconnects during both unchanged and upgraded gateway rollouts while testing #1481.
Add a small Go helper, built as a standalone ko image and mounted read-only into the gateway using an image volume. Keep Envoy's upstream image unchanged so its patch updates remain independent of the helper build. preStop invokes
/drain-helper/ko-app/draindirectly—no shell, copying, or init container.The helper uses
context.WithTimeoutwithDRAIN_TIME_SECONDS(default 15 seconds) to bound the whole hook. It POSTs to the loopback admin endpoint, checks for HTTP 200, and waits for the remainder of the drain window, including on failure.This uses image volumes, stable in Kubernetes 1.36, which the next Knative release targets.
Checked mounting and execution on kind 1.35 with ImageVolume enabled and containerd 2.2. The mounted helper ran as UID 65534, triggered
Connection: close, waited for the configured duration, and completed the actual preStop hook during pod deletion. The 1.36 kind node image wasn't available for a direct check. The initial helper also passed focused unit tests and lint.``
release-note
``Kourier gateways now initiate graceful connection draining during shutdown without depending on curl in the Envoy image. The helper is supplied through a Kubernetes image volume.