Revision ad85cd50b5216ef3ddc3a7347787d10fe5ab2a0d authored by Marco Iorio on 19 June 2024, 07:41:22 UTC, committed by Julian Wiedmann on 20 June 2024, 05:43:35 UTC
In order to prevent possible race conditions when watching clustermesh
config file changes, once we receive a file change notification, we
first add that path to the list of watched ones and, if it wasn't
already registered, recurse again. This prevents missing possible
updates that could have happened in the time window between the
reading of the file and the registration of the watcher.

However, the previous implementation was lacking a return statement,
hence causing the add notification to be actually triggered twice,
if the two iterations read two different versions of the file.
Practically speaking, this is extremely unlikely to lead to actual
issues, unless multiple back-to-back changes are performed in sequence
(as we do in the unit tests).

Regardless, let's fix it by adding the missing return statement.

Fixes: 106d0981ee35 ("clustermesh: fix config watcher race condition with back-to-back changes")
Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
1 parent db1cd13
History
File Mode Size
.devcontainer
.github
.nvim
.vscode
Documentation
api
bpf
bugtool
cilium-dbg
cilium-health
clustermesh-apiserver
contrib
daemon
examples
hack
hubble
hubble-relay
images
install
operator
pkg
plugins
test
tools
vendor
.authors.aux -rw-r--r-- 416 bytes
.clang-format -rw-r--r-- 7.6 KB
.clomonitor.yml -rw-r--r-- 984 bytes
.gitattributes -rw-r--r-- 887 bytes
.gitignore -rw-r--r-- 1.8 KB
.golangci.yaml -rw-r--r-- 4.4 KB
.mailmap -rw-r--r-- 6.9 KB
AUTHORS -rw-r--r-- 52.1 KB
CODEOWNERS -rw-r--r-- 28.2 KB
CODE_OF_CONDUCT.md -rw-r--r-- 2.2 KB
CONTRIBUTING.md -rw-r--r-- 691 bytes
FURTHER_READINGS.rst -rw-r--r-- 6.4 KB
LICENSE -rw-r--r-- 11.1 KB
MAINTAINERS.md -rw-r--r-- 4.6 KB
Makefile -rw-r--r-- 25.4 KB
Makefile.defs -rw-r--r-- 7.5 KB
Makefile.docker -rw-r--r-- 7.1 KB
Makefile.kind -rw-r--r-- 16.8 KB
Makefile.quiet -rw-r--r-- 818 bytes
README.rst -rw-r--r-- 19.6 KB
SECURITY-INSIGHTS.yml -rw-r--r-- 2.1 KB
SECURITY.md -rw-r--r-- 1.0 KB
USERS.md -rw-r--r-- 35.2 KB
VERSION -rw-r--r-- 11 bytes
Vagrantfile -rw-r--r-- 14.9 KB
go.mod -rw-r--r-- 13.6 KB
go.sum -rw-r--r-- 96.9 KB
netlify.toml -rw-r--r-- 92 bytes
stable.txt -rw-r--r-- 8 bytes
vagrant_box_defaults.rb -rw-r--r-- 334 bytes

README.rst

back to top