fix: panic in external audit watcher#36298
Merged
Conversation
This commit fixes a possible panic in the cluster External Audit watcher that can occur whenever the underlying backend watcher closes unexpectedly, and resulted in a double-close of the `initialized` channel. This fix here is to switch from closing an "initialized" channel whenever a watcher is initialized, to periodically writing to a "running" channel during the events watch loop, whenever there is a listener waiting on the channel. This is what some other watchers (e.g. HeadlessAuthenticationWatcher) already do, and allow for the test to wait for the new watcher to init after simulating a failed watcher. Changelog: Fixed potential panic after backend watcher failure.
rosstimothy
approved these changes
Jan 4, 2024
atburke
approved these changes
Jan 4, 2024
|
@nklaassen See the table below for backport results.
|
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.
This commit fixes a possible panic in the cluster External Audit watcher that can occur whenever the underlying backend watcher closes unexpectedly, and resulted in a double-close of the
initializedchannel.This fix here is to switch from closing an "initialized" channel whenever a watcher is initialized, to periodically writing to a "running" channel during the events watch loop, whenever there is a listener waiting on the channel.
This is what some other watchers (e.g. HeadlessAuthenticationWatcher) already do, and it allows for the test to wait for the new watcher to init after simulating a failed watcher.
Changelog: Fixed potential panic after backend watcher failure.