fix(xds): reject a zero cert refresh_interval#2729
Open
W4lspirit wants to merge 1 commit into
Open
Conversation
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).
|
|
Member
|
I just noticed this is still a draft after assigning @YutaoMa as a review -- is this still supposed to be a draft @W4lspirit? |
Author
|
@dfawley Sorry I was responding to an incident, I was waiting for the cla check to pass before moving it to ready |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 > 0check).