Skip to content

fix(runtime): drain admitted proxy requests within the shutdown budget - #164

Merged
RentnerKev merged 2 commits into
mainfrom
codex/issue-159-request-drain
Oct 4, 2026
Merged

RentnerKev merged 2 commits into
mainfrom
codex/issue-159-request-drain

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

An admitted 16-second request used to reset after roughly ten seconds during appliance shutdown, even with a 30-second container stop budget. Caddy now receives a dedicated finite shutdown budget: up to 20 seconds for stop control inside one shared 22-second control/drain deadline, followed by at most one second to reap an owned child. Ordinary API/probe limits remain unchanged. Compose explicitly allows 30 seconds.

Failure paths terminate only the controller-owned child. Six Unix regression tests cover delayed acknowledgement, the shared absolute deadline, absent/rejected/stalled control and nonzero child exit. The production workflow also exercises real HTTP and CA-verified HTTPS against an isolated upstream, refreshing dynamic ports after restart.

Validation:

  • All 24 checks on this independent PR head pass, including Production Smokes, CodeQL, Rust, scale and upgrade compatibility.
  • The unchanged baseline image fails the new 16-second drain regression; the fixed image passes both protocols with complete 200 responses at about 16.02 seconds and stops in 17.61 seconds.
  • Deliberately blocked 60-second requests are reset after about 20.27 seconds; the container stops in 20.76 seconds. Both phases exit 0 with no OOM or Docker SIGKILL; all six smoke assertions pass.
  • Six Unix shutdown tests plus three transport tests and Linux lib-Clippy pass. Owned Docker containers, volumes and networks were removed.

The drain budget is finite; indefinitely blocked requests are intentionally terminated. A single-container recreation still interrupts its listener.

Fixes #159.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: RentnerKev/RentnerProxy/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 03ceaf5c-0aef-46a8-99e7-986cd4433401
📥 Commits

Reviewing files that changed from the base of the PR and between d7e916d and 2be8230.

📒 Files selected for processing (12)
  • .github/scripts/Types/appliance-drain-smoke.types.ts
  • .github/scripts/appliance-drain-fixture.ts
  • .github/scripts/appliance-drain-request.ts
  • .github/scripts/appliance-drain-smoke.ts
  • .github/scripts/appliance-drain-upstream.ts
  • .github/workflows/production-smokes.yml
  • README.md
  • core/src/runtime/engine.rs
  • core/tests/private/caddy_shutdown.rs
  • core/tests/private/caddy_transport.rs
  • docker-compose.yml
  • docs/caddy-shutdown.md
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: runtime Caddy and privileged controller runtime behavior. area: docker Docker images, Compose configuration, and deployment. area: ci Continuous integration and GitHub automation. labels Oct 3, 2026
@RentnerKev RentnerKev added area: proxy Proxy host configuration and request forwarding. bug Something isn't working labels Oct 3, 2026
@RentnerKev
RentnerKev marked this pull request as ready for review October 3, 2026 23:39
@RentnerKev
RentnerKev merged commit 79fc260 into main Oct 4, 2026
27 of 29 checks passed
@RentnerKev
RentnerKev deleted the codex/issue-159-request-drain branch October 4, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci Continuous integration and GitHub automation. area: docker Docker images, Compose configuration, and deployment. area: proxy Proxy host configuration and request forwarding. area: runtime Caddy and privileged controller runtime behavior. bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(runtime): align proxy request draining with the appliance shutdown budget

1 participant