Skip to content

Renew gRPC and REST connections after max_connection_age#6547

Open
guilload wants to merge 1 commit into
mainfrom
guilload/expire-in-flight-connections
Open

Renew gRPC and REST connections after max_connection_age#6547
guilload wants to merge 1 commit into
mainfrom
guilload/expire-in-flight-connections

Conversation

@guilload

Copy link
Copy Markdown
Member

Description

Renew gRPC and REST connections after max_connection_age when set so hot-reloads of mTLS certs, keys, etc. takes effect.

How was this PR tested?

Added unit and integration tests

@guilload guilload force-pushed the guilload/expire-in-flight-connections branch 2 times, most recently from 6b01139 to 34ce5f1 Compare June 29, 2026 20:18
@guilload guilload force-pushed the guilload/expire-in-flight-connections branch from 34ce5f1 to 204b588 Compare June 29, 2026 21:29
@guilload guilload marked this pull request as ready for review June 29, 2026 21:30
@guilload guilload requested review from a team as code owners June 29, 2026 21:30
@guilload guilload requested a review from trinity-1686a June 29, 2026 21:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 204b588544

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +459 to +465
let max_connection_age_grace_opt = match max_connection_age_opt {
Some(max_connection_age) => max_connection_age.grace,
None => None,
};
let max_connection_age_grace_sleep = match max_connection_age_grace_opt {
Some(max_connection_age_grace) => {
Either::Left(tokio::time::sleep(max_connection_age_grace))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep max-age grace out of shutdown drains

When the global shutdown token wins the first select!, this same grace timeout is still used, so any REST config that sets rest.max_connection_age_grace will force-close otherwise graceful process shutdowns after that interval. For example, a long-running REST request during a restart will now be dropped after the max-age grace (30s in the sample config), even though the old GracefulShutdown path waited for in-flight connections and tonic's analogous option only applies after a connection exceeds max_connection_age; track whether phase 2 was entered because of max age before applying this timeout.

Useful? React with 👍 / 👎.

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.

1 participant