Skip to content

fix: panic in external audit watcher#36298

Merged
nklaassen merged 1 commit intomasterfrom
nklaassen/fix-watcher-panic
Jan 4, 2024
Merged

fix: panic in external audit watcher#36298
nklaassen merged 1 commit intomasterfrom
nklaassen/fix-watcher-panic

Conversation

@nklaassen
Copy link
Copy Markdown
Contributor

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 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.

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.
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from ravicious January 4, 2024 20:13
@nklaassen nklaassen added this pull request to the merge queue Jan 4, 2024
Merged via the queue into master with commit 3960413 Jan 4, 2024
@nklaassen nklaassen deleted the nklaassen/fix-watcher-panic branch January 4, 2024 20:44
@public-teleport-github-review-bot
Copy link
Copy Markdown

@nklaassen See the table below for backport results.

Branch Result
branch/v14 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants