Skip to content

SDS filesystem watches operate on file parent rather than grandparent #13663

@htuch

Description

@htuch

#10163 which resolved #9359 added support for inotify watching of directories to catch symlink rotation. I think this might have a bug. Specifically, if we have a cert in /foo/bar/cert.pem and perform a symlink rotation on bar, we don't see any SDS filesystem action.

The reason is that the watch is added on bar, rather than foo, see

watcher_->addWatch(absl::StrCat(result.directory_, "/"),
. The watcher test in the original PR actually does that, see https://github.com/envoyproxy/envoy/pull/10163/files#diff-c2abed8cf8fe469d48e4c17a0cfc0a35ef532c8c578c90f1e675a82d8200a01cR168.

@tsaarni can you confirm that this is an issue? I'm surprised it worked in your Contour example, but maybe some other feature was triggering the inotify, e.g. the file deletes?

I think the solution is to watch the grandparent, rather than the parent directory.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions