plugins/bundle: prevent ns-level polling by validating intervals #8082
+13
−5
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.
Fix polling interval validation in Reconfigure to avoid nanosecond ticker loops
Fixes: #8081
Why the changes in this PR are needed?
When
Reconfigure()is called on the bundle plugin, the provided bundle configurationis applied without validating
polling.min_delay_secondsandpolling.max_delay_seconds.This means that even when a user explicitly configures a valid value such as:
the actual polling interval used by the downloader may still fall back to 10 nanoseconds
(or effectively 0 nanoseconds) instead of 10 seconds.
In practice, this results in an extremely tight polling loop and thousands of HTTP requests
per second.
This behavior is incorrect and inconsistent with the user’s configuration, and validation
is required to ensure that the polling delays reflect the intended seconds-based values.
What are the changes in this PR?
Reconfigure()flow.Notes to assist PR review:
downloader from entering a tight polling loop.
v1/plugins/bundle/plugin.go.Further comments: