Page MenuHomeVyOS Platform

Use inotify file watching where applicable
Closed, ResolvedPublic

Description

A lot of time processes communicate through creating and modifying files. Examples include: the commit lock, the keepalived JSON state dump, and many more.

Right now we are using a wide range of approaches "sleep a bit and hope for the best" to "check repeatedly". They all are problematic in different ways because either there are random failures, or there's a long timeout or a busy wait.

Linux kernel provides inotify API that mostly solved all these problems.

Details

Version
-
Is it a breaking change?
Behavior change

Related Objects

Mentioned In
rVYOSONEX97bb3a93c938: T3663: remove some unused sleep imports.
rVYOSONEXbc0c0bbf52a1: T3663: use inotify-based watching for the IPsec process restart.
rVYOSONEXe41a4ebbb11f: T3663: use inotify-based watching for the IPsec process restart.
rVYOSONEXcb4ace6468aa: T3663: add a small sleep between polling for a new inotify event.
rVYOSONEXe9c427d9edf2: T3663: add a small sleep between polling for a new inotify event.
rVYOSONEX8e5d635a3c06: T3663: fixed in the inotify-based vrrp script.
rVYOSONEX4914f140d977: vyos.util: T3663: move inotify-based imports to function level
rVYOSONEXe7f89d4d45fe: T3663: fix the call to time.time() to match the new import scheme.
rVYOSONEX597e3b47d6e9: T3663: add pre_hook argument to util.wait_for_inotify
rVYOSONEX517d78973430: T3663: python3-inotify should be a runtime dependency
rVYOSONEX26b21c46e3af: T3663: prerequisites for inotify-based watching implementations.
rVYOSONEXf0727f83beea: T3663: use inotify-based watching in "show vrrp".
rVYOSONEX5c52cbc18a73: T3663: use inotify-based watching in "show vrrp".
rVYOSONEX27936c01b8ab: T3663: add a dependency on python3-inotify.
rVYOSONEXe6bce67f2ab2: T3663: add pre_hook argument to util.wait_for_inotify
rVYOSONEX63713fc60c0f: T3663: fix the call to time.time() to match the new import scheme.
rVYOSONEX859afacfeafc: T3663: use inotify-based waiting for keepalived in `show vrrp`
rVYOSONEX50b8d38abdb1: T3663: python3-inotify should be a runtime dependency
rVYOSONEX70efa3dd54bc: vyos.util: T3663: move inotify-based imports to function level
rVYOSONEXe0a754a0a608: T3663: prerequisites for inotify-based watching implementations.

Event Timeline

Other instances:

Will not benefit from inotify:

May benefit:

Debatable: