Repository navigation
Backlog
Labels
Description
Problem
Kubernetes can only probe the gateway with tcpSocket today. The kernel completes the TCP handshake while the listener socket is open, so a gateway whose runtime is deadlocked, whose connection pool is exhausted, or that is stuck on a dead backend still passes, is never restarted, and keeps receiving traffic. The DocumentDB Kubernetes operator and users running the gateway on their own CloudNativePG both need a real check (documentdb/documentdb-kubernetes-operator#522).
What exists today doesn't cover this:
documentdb_gateway checkstarts a new process that tests PostgreSQL connectivity. It doesn't tell whether the running gateway is serving, and as a liveness probe it would restart a healthy gateway whenever PostgreSQL is down.ping/hellowork without authentication and exercise the listener, TLS and request loop, but the gateway image has no client to send them from anexecprobe.- Every probe connection is logged as
ERROR … Gateway runtime connection failed([gateway] Restart, shutdown and outage handling gaps #768 item 6), so any probe floods the logs and breaks error-based alerting.
Proposal
documentdb_gateway probesubcommand forexecprobes. It connects to the local listener (honoring the configured TLS; skip certificate verification for loopback), sendshello, and exits 0 on a valid reply within--timeout(default 2 s), 1 otherwise. No credentials needed. This detects a hung runtime or listener, which is what a liveness probe needs.- Readiness mode (
probe --ready, or a loopback-only HTTP/Unix-socket endpoint): also confirms the running process can get a connection from its PostgreSQL pool within the timeout, so a gateway with an exhausted or broken pool reports not ready. This must run inside the gateway process, not as a separate process likecheck. - Quiet probe connections: log connections that close before sending a complete request, and probe connections, at
debug, noterror([gateway] Restart, shutdown and outage handling gaps #768 item 6). - Document recommended probe settings (period, timeout, failure threshold).
Acceptance
probereturns 1 within the timeout when the request loop is blocked, and 0 on a healthy gateway, with TLS on and off.probe --readyreturns 1 while the PostgreSQL pool can't hand out a connection.- A probe every 10 s produces no
ERRORlog lines.
Related
- [gateway] Restart, shutdown and outage handling gaps #768 (restart, shutdown and outage handling; item 6 covers the error logging)
- sidecar-injector: configurable probes for the gateway container (and a real health check) documentdb-kubernetes-operator#522 (configurable gateway probes in the operator's sidecar injector)
- feat: add PostgreSQL, catalog, data volume, and network metrics to the OTel sidecar, plus gateway liveness probes documentdb-kubernetes-operator#475 (fixed
tcpSocketliveness probe)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
documentdb-triage-tool commentedon Nov 24, 2026
🤖 Auto-triaged by documentdb-triage-tool.
Applied:
gateway,enhancementProject fields suggested: Component
gateway· PriorityP2· EffortL· StatusTriageConfidence: 0.90 (llm)
Reasoning
LLM: Adds a new
probesubcommand plus readiness mode and log-level fixes across the gateway component, touching multiple files and runtime behavior for Kubernetes operability.If a label is wrong, ping
@patty-chowso the rules can be tuned. Issues with component labels are left alone; PR component labels are reconciled from changed paths on every run.