Skip to content

Detect external bootc status changes via fsnotify (milestone 4d)#59

Open
alicefr wants to merge 2 commits into
bootc-dev:mainfrom
alicefr:milestone-4d
Open

Detect external bootc status changes via fsnotify (milestone 4d)#59
alicefr wants to merge 2 commits into
bootc-dev:mainfrom
alicefr:milestone-4d

Conversation

@alicefr

@alicefr alicefr commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Bootc changes are detected via fsnotify or via a polling mechanism.

This is built on top of #50

@alicefr alicefr force-pushed the milestone-4d branch 4 times, most recently from 8021bcf to 74c721d Compare June 12, 2026 13:43
@alicefr alicefr force-pushed the milestone-4d branch 3 times, most recently from 79041e3 to 069de0b Compare June 22, 2026 11:30
alicefr added 2 commits June 22, 2026 11:37
Add a StatusWatcher component that detects external bootc status
changes via fsnotify on /proc/1/root/ostree/bootc (with fallback
to /proc/1/root/sysroot/state/deploy for composefs), plus a
configurable polling interval as a safety net.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Add --poll-interval flag to the daemon binary and wire the
StatusWatcher channel into the reconciler as a second
WatchesRawSource alongside switchDone.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Alice Frosi <afrosi@redhat.com>
Complete(r)
Named("bootcnode")

if r.StatusChanged != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When would this be nil?

Comment thread cmd/daemon/main.go

func main() {
var pollInterval time.Duration
flag.DurationVar(&pollInterval, "poll-interval", 5*time.Minute, "Interval for polling bootc status as a fallback to fsnotify")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perhaps bootc-pool-interval?

DefaultFallbackPath = "/proc/1/root/sysroot/state/deploy"
)

type StatusWatcher struct {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So the way I was thinking about this was more like if it were an "informer cache" for bootc status.

So here we would maintain the deserialized status, and the daemon whenever it needed it, would query the status watcher and that either returns the in-memory object (if fsnotify is known healthy), or run bootc status --json.

The polling fallback still makes sense I guess to keep the BootcNode status up to date even if the daemon itself doesn't need to do any work. But ideally we only start polling once fsnotify fails?

WDYT?

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.

2 participants