inotify: stop active watchers when sync is disabled - #115
Open
manishtwari wants to merge 2 commits into
Open
Conversation
aryakpadman
approved these changes
Aug 12, 2026
aryakpadman
reviewed
Aug 12, 2026
riya461
approved these changes
Aug 14, 2026
When sync is disabled, active DataWatcher instances may remain blocked waiting for an inotify event in onDataChange(). This prevents the monitor coroutines from exiting immediately. If sync is re-enabled before the old monitor coroutine exits, the code can still use the existing watcher. The new monitor task can enter onDataChange() while the old monitor task is already waiting on the same fdio object. sdbusplus fdio rejects a second pending await on the same fdio object, so the service terminates with: ``` what(): fdio_completion started with another await already pending! ``` Add DataWatcher::stop() to remove the active inotify watch descriptors. Removing a watch generates an IN_IGNORED event, which makes the inotify file descriptor readable and wakes the pending fdio::next() operation. IN_IGNORED is not treated as a data change, so no sync operation is triggered. Once onDataChange() returns, the monitor loop observes that sync is disabled and exits. The existing scope cleanup then removes the DataWatcher from the active watcher map. During failover, the passive BMC becomes active without restarting the application. Any watcher created for the previous BMC role may therefore remain active. Stopping the existing watchers ensures that they are removed before sync events are started again for the new BMC role. Call stop() for all active watchers when the DisableSync property is set. Change-Id: I7e21ded548ff56eeaf7885aeafdefc7fd3a3c13c Signed-off-by: Manish Tiwari <tmanish.in@gmail.com>
manishtwari
force-pushed
the
dev/removeWatcher
branch
from
August 17, 2026 06:14
982dc90 to
c0eeccb
Compare
…bm-openbmc#110)" This fix is no longer needed as the root cause is addressed in the commit c0eeccb. This reverts commit 79c8879. Change-Id: I79a55c8dcecac6f1ed05c674546953077a45861b Signed-off-by: Manish Tiwari <tmanish.in@gmail.com>
manishtwari
force-pushed
the
dev/removeWatcher
branch
from
August 17, 2026 08:54
ba69c79 to
895434c
Compare
spinler
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When sync is disabled, active DataWatcher instances may remain blocked waiting for an inotify event in onDataChange(). This prevents the monitor coroutines from exiting immediately.
Add DataWatcher::stop() to remove the active inotify watch descriptors. Removing a watch generates an IN_IGNORED event, which makes the inotify file descriptor readable and wakes the pending fdio::next() operation.
IN_IGNORED is not treated as a data change, so no sync operation is triggered. Once onDataChange() returns, the monitor loop observes that sync is disabled and exits. The existing scope cleanup then removes the DataWatcher from the active watcher map.
During failover, the passive BMC becomes active without restarting the application. Any watcher created for the previous BMC role may therefore remain active. Stopping the existing watchers ensures that they are removed before sync events are started again for the new BMC role.
Call stop() for all active watchers when the DisableSync property is set.