Skip to content
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

fix incorrect use of fsnotify in configtls #8439

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

haoqixu
Copy link
Member

@haoqixu haoqixu commented Sep 13, 2023

Description: fix #8438

Link to tracking Issue: #8438

@haoqixu haoqixu requested review from a team and codeboten September 13, 2023 16:33
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Please add a changelog entry for the bug fix 👍🏻

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
config/configtls/clientcasfilereloader.go 100.00%

📢 Thoughts on this report? Let us know!.

@@ -112,7 +112,7 @@ func (r *clientCAsFileReloader) handleWatcherEvents() {
// NOTE: k8s configmaps uses symlinks, we need this workaround.
// original configmap file is removed.
// SEE: https://martensson.io/go-fsnotify-and-kubernetes-configmaps/
if event.Op == fsnotify.Remove || event.Op == fsnotify.Chmod {
if event.Has(fsnotify.Remove) || event.Has(fsnotify.Chmod) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My confusion here is why we need to monitor for the chmod...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly because of this fsnotify/fsnotify#421?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inotify generates IN_DELETE_SELF for the watched file only when its link count is reduces to 0. Looks like it is used to handle this situation. 🤔
https://github.com/fsnotify/fsnotify/blob/v1.6.0/backend_inotify.go#L26-L33

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @haoqixu!

@codeboten codeboten merged commit 07938f2 into open-telemetry:main Sep 15, 2023
31 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect use of fsnotify in configtls
3 participants