Skip to content

feat: make the shutdown grace period configurable#1758

Merged
AmanGIT07 merged 1 commit into
mainfrom
fix/configurable-shutdown-grace
Jul 15, 2026
Merged

feat: make the shutdown grace period configurable#1758
AmanGIT07 merged 1 commit into
mainfrom
fix/configurable-shutdown-grace

Conversation

@AmanGIT07

Copy link
Copy Markdown
Contributor

Summary

The shutdown grace period is now a config value instead of a hardcoded
constant.

Changes

  • New app.shutdown_grace_period config field (default 10s, env
    FRONTIER_APP_SHUTDOWN_GRACE_PERIOD), documented in the sample
    config.
  • The connect, metrics, and UI server shutdowns all read it; the
    connectServerGracePeriod constant is removed.
  • Added TestGracefulShutdownCutsOffRequestsAfterGracePeriod: a
    request longer than the grace period is cut off and the wait releases
    on schedule.

Test Plan

  • All pkg/server shutdown tests pass with -race
  • golangci-lint reports 0 issues
  • Full build passes

🤖 Generated with Claude Code

Replace the hardcoded 10s constant with app.shutdown_grace_period
(default 10s), used by the connect, metrics, and UI server drains.
Add a test proving requests longer than the grace period get cut off.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Jul 14, 2026 8:39pm

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 651c2619-4995-4b73-ad37-770b77fc5aa5

📥 Commits

Reviewing files that changed from the base of the PR and between afc1be7 and 4cdf9ac.

📒 Files selected for processing (5)
  • config/sample.config.yaml
  • pkg/server/config.go
  • pkg/server/serve_ui_test.go
  • pkg/server/server.go
  • pkg/server/server_test.go

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a configurable shutdown grace period for allowing in-flight requests to finish.
    • The default shutdown grace period is 10 seconds.
    • Applied the setting consistently across UI, API, Connect, and metrics servers.
  • Bug Fixes

    • Shutdown now stops waiting after the configured grace period, even if requests remain active.

Walkthrough

Changes

Shutdown grace period

Layer / File(s) Summary
Configure and apply shutdown grace period
config/sample.config.yaml, pkg/server/config.go, pkg/server/server.go
Adds a configurable ShutdownGracePeriod with a 10-second default and applies it to UI, Connect, metrics, and shared graceful shutdown paths.
Validate shutdown timing
pkg/server/server_test.go, pkg/server/serve_ui_test.go
Updates shutdown tests to use explicit grace periods and verifies requests are cut off after the configured duration.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested reviewers: rohilsurana

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 29366563979

Coverage increased (+0.008%) to 45.211%

Details

  • Coverage increased (+0.008%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (4 of 5 lines covered, 80.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
pkg/server/server.go 5 4 80.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 37690
Covered Lines: 17040
Line Coverage: 45.21%
Coverage Strength: 12.69 hits per line

💛 - Coveralls

@AmanGIT07 AmanGIT07 merged commit af5fda3 into main Jul 15, 2026
10 of 11 checks passed
@AmanGIT07 AmanGIT07 deleted the fix/configurable-shutdown-grace branch July 15, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants