Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon: Automatically reload sysroot before txn #1310

Closed
wants to merge 1 commit into from

Conversation

cgwalters
Copy link
Member

In this PR: #1309
I was hitting race conditions running ostree admin pin then
rpm-ostree cleanup as it was possible that the daemon hadn't handled
the inotify on the sysroot and reloaded the deployment state before
the txn request came in.

Close this race by doing an implicit reload before starting a txn.
This is a pretty efficient operation because for the sysroot we're
just doing a stat() and comparing mtime.

Implementation wise, change the external API to drop the "did change"
boolean as nothing outside of the sysroot.c file used it.

A followup to this would be changing the status CLI to call a
(new) DBus API like RequestReload that at least did the sysroot
reload if the daemon was otherwise idle or so? And it'd be available
to unprivileged users.

In this PR: coreos#1309
I was hitting race conditions running `ostree admin pin` then
`rpm-ostree cleanup` as it was possible that the daemon hadn't handled
the inotify on the sysroot and reloaded the deployment state before
the txn request came in.

Close this race by doing an implicit `reload` before starting a txn.
This is a pretty efficient operation because for the sysroot we're
just doing a `stat()` and comparing mtime.

Implementation wise, change the external API to drop the "did change"
boolean as nothing outside of the `sysroot.c` file used it.

A followup to this would be changing the `status` CLI to call a
(new) DBus API like `RequestReload` that at least did the sysroot
reload if the daemon was otherwise idle or so?  And it'd be available
to unprivileged users.
@jlebon
Copy link
Member

jlebon commented Mar 23, 2018

So I built on top of this in #1311, but didn't approve this one yet in case you had a better way of addressing both cases at once.

@rh-atomic-bot
Copy link

☔ The latest upstream changes (presumably 706506b) made this pull request unmergeable. Please resolve the merge conflicts.

@cgwalters
Copy link
Member Author

Included in #1311

@cgwalters cgwalters closed this Mar 23, 2018
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.

3 participants