Skip to content

fix(xds): reject a zero cert refresh_interval#2729

Open
W4lspirit wants to merge 1 commit into
grpc:masterfrom
W4lspirit:cert-provider-guard-zero-refresh
Open

fix(xds): reject a zero cert refresh_interval#2729
W4lspirit wants to merge 1 commit into
grpc:masterfrom
W4lspirit:cert-provider-guard-zero-refresh

Conversation

@W4lspirit

Copy link
Copy Markdown

Context

The file-watcher certificate provider's duration deserializer already rejects negative refresh intervals, but a refresh_interval of "0s" was accepted and parsed to Duration::ZERO.

tokio::time::interval(ZERO) then panics inside the spawned refresh task, silently killing certificate rotation while provider construction still succeeds.

Motivation

Improve runtime error message when user miss-configured the refresh duration.

Solution

Extend the existing guard to reject zero as well as negative durations, so the misconfiguration surfaces as a clear bootstrap error (matching grpc-java's refreshInterval > 0 check).

The file-watcher certificate provider's duration deserializer already
rejects negative refresh intervals, but a refresh_interval of "0s" was
accepted and parsed to 'Duration::ZERO'.
'tokio::time::interval(ZERO)' then panics inside the spawned refresh
task, silently killing certificate rotation while provider construction
still succeeds.

Extend the existing guard to reject zero as well as negative durations,
so the misconfiguration surfaces as a clear bootstrap error (matching
grpc-java's `refreshInterval > 0` check; grpc-go coerces 0 to its
default instead).
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 10, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: W4lspirit / name: Ismael Hajy (1d78ab4)

@dfawley dfawley requested a review from YutaoMa July 10, 2026 17:37
@dfawley

dfawley commented Jul 10, 2026

Copy link
Copy Markdown
Member

I just noticed this is still a draft after assigning @YutaoMa as a review -- is this still supposed to be a draft @W4lspirit?

@W4lspirit

Copy link
Copy Markdown
Author

@dfawley Sorry I was responding to an incident, I was waiting for the cla check to pass before moving it to ready

@W4lspirit W4lspirit marked this pull request as ready for review July 10, 2026 19:01
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