/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeout

Open Beginner friendly
#10,562 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@floriankoch is already working on this.

Since Nov 8, 2026.

  • #10563 by @floriankoch — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
api, backend

Research direction

Read internal/cmd/envoy/shutdown_manager.go, especially the HTTP server and /shutdown/ready handler around lines 43–140; then review the readiness timeout generation in internal/infrastructure/kubernetes/proxy/resource.go around lines 280–290. Reproduce the empty response with a long --ready-timeout and a delayed marker, then verify the endpoint returns HTTP 200 when the marker appears and an HTTP error when readiness times out.

Written by the indexing model from the issue text.

Description

triage

Description:

The shutdown manager’s HTTP server configures WriteTimeout: 10s, while its /shutdown/ready handler can wait substantially longer for /tmp/shutdown-ready.

For example, configuring spec.shutdown.drainTimeout: 165s generates --ready-timeout=175s. If the marker appears after the HTTP write deadline, the handler detects readiness but the client can receive an empty response instead of HTTP 200.

Expected behavior: the endpoint returns HTTP 200 when the marker appears within readyTimeout, or its HTTP error response when that timeout expires.

Relevant implementation:

Suggested fix:

Extend the write deadline specifically for /shutdown/ready using http.NewResponseController(w).SetWriteDeadline(...) before polling begins. Set it to readyTimeout plus sufficient allowance for the final polling interval and response transmission, for example 5 seconds. Other endpoints can retain the existing server write timeout.

Previous closed, unmerged PRs address the same problem:

  • #10186: endpoint-specific write deadline and real HTTP regression tests.
  • #10074: server-wide write timeout adjustment.

Repro steps:

  1. Start the shutdown manager from the unmodified envoyproxy/gateway:v1.10.0 image with an empty, writable /tmp:

    envoy-gateway envoy shutdown-manager --ready-timeout=175s
    
  2. Once /healthz responds, send a request from a client that can reach the manager:

    curl --http1.1 --max-time 40 -v \
      http://<manager>:19002/shutdown/ready
    
  3. Approximately 20 seconds after the request starts, create the marker in the manager’s filesystem:

    touch /tmp/shutdown-ready
    
  4. Observe the client response and manager logs.

Use a fresh manager process and initially absent marker for each run.

Observed results:

Marker created after Request duration Result
Approximately 2 seconds 2.06 seconds HTTP 200
Approximately 20 seconds 20.11 seconds curl exit code 52; no HTTP response

Environment:

  • Envoy Gateway: v1.10.0
  • Image: envoyproxy/gateway:v1.10.0
  • Container platform: Linux AMD64, running through Apple Container on macOS
  • Shutdown manager: --ready-timeout=175s
  • Client protocol: HTTP/1.1
  • Envoy proxy: not started; this reproduction exercises the shutdown manager independently
  • Kubernetes: not required for this reproduction

Logs:

Client output for the approximately 20-second case:

curl: (52) Empty reply from server

Corresponding shutdown-manager log messages:

06:43:08.439  received shutdown ready request
06:43:28.510  shutdown readiness detected

No Envoy access logs are produced because the request goes directly to the shutdown manager.

Dominant language
Go
Stars
3.1k
Forks
940
Avg merge
2d 8h
Merged PRs (30d)
177

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from envoyproxy/gateway

All issues in envoyproxy/gateway

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.