-
Notifications
You must be signed in to change notification settings - Fork 242
Use a delaying enqueue handler for drift detection #3401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
a3b4333
to
b57f550
Compare
aruiz14
added a commit
that referenced
this pull request
Feb 28, 2025
manno
approved these changes
Mar 4, 2025
Co-authored-by: Mario Manno <mario.manno@gmail.com>
weyfonk
added a commit
to weyfonk/fleet
that referenced
this pull request
Mar 11, 2025
This function became obsolete when using a delaying enqueue handler for drift detection; see fleet#3401 [1]. [1]: rancher#3401
weyfonk
added a commit
to weyfonk/fleet
that referenced
this pull request
Mar 12, 2025
This function became obsolete when using a delaying enqueue handler for drift detection; see fleet#3401 [1]. [1]: rancher#3401
weyfonk
added a commit
to weyfonk/fleet
that referenced
this pull request
Mar 12, 2025
This function became obsolete when using a delaying enqueue handler for drift detection; see fleet#3401 [1]. [1]: rancher#3401
manno
pushed a commit
that referenced
this pull request
Mar 13, 2025
* Remove unused function This function became obsolete when using a delaying enqueue handler for drift detection; see fleet#3401 [1]. [1]: #3401 * Modernise output setting in deployer integration tests This makes use of `SetOut` and `SetErr` instead of `SetOutput`, which is deprecated. * Remove unused parameter from test helper methods That parameter is no longer necessary now that our test infrastructure uses `default` as its namespace.
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.
Refers to #3402
These changes introduce an artificial delay for enqueuing
BundleDeployment
reconciliations when Fleet agents detect changes in the monitored deployed resources.Non-ready resources often produce multiple successive Kubernetes events in a short period of time, which would cause unnecessary noise and stress not only for the BundleDeployment reconciler running in the agent, but also in the upstream
Bundle
status reconciler, since this would also be enqueued to reflect the new state from their associatedBundleDeployment
.Adding a short delay allows aggregating all those events into a single one (every X seconds, depending on the frequency of events and the configured delay) by using the workqueue's
TypedDelayingInterface
instead of usingAdd
, which is immediate.The downside of this obviously a delay in the notification for drift detection, but it's just a matter of finding the correct balance, for which I believe 5 seconds is a reasonable initial value.
Note: this PR also also includes 2 misc changes:
Testing
Then observed the timestamps in the agent logs:
Note: these modifications don't actually cause further updates in the BundleDeployment status, as they don't contain enough detail (e.g. the patch being displayed is only the merge-patch needed to correct the drift, but is not a diff containing the current value)
BundleDeployment
updates, I created asimple
Bundle, which deploys a sample application, including afronted
Deployment
.reason: Error
and a custom message, which makes Fleet believe this resource is in non-ready state.