-
Notifications
You must be signed in to change notification settings - Fork 249
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
engine: fix logging interactions with fetch-offline #1075
Conversation
Right now, even if `fetch-offline` gets `ErrNeedNet`, it might've still logged info about configs which it did fetch before hitting the error. This then results in double-logging of e.g. the base config and at least the first layer of user configs when `fetch` re-fetches them. But it's also misleading, because anything which runs between `fetch-offline` and `fetch` and sees the journal messages will think that Ignition did successfully fetch and cache the merged user config, when it did not. And sadly, we still have code which peek at the cached config for `$reasons` (legacy-style RHCOS LUKS is one of them, RHCOS FIPS support is another), and those bits get thrown off by seeing the logging messages yet not seeing a cached Ignition config. Let's tweak things so that we buffer those messages and only actually write them out once we've successfully acquired the configs. While we're here, clean up the base config logging hack now that the `fetch` stages are canonical.
Only compile-tested for now. |
Using the journal to communicate is trickier than we thought. Well, I guess in general all IPC is tricky. Problem description makes total sense to me. The patch looks right to me superficially but I don't know the fetch code very well. |
OK, tested this now and ready for review! And also added another commit which fixes something else worth mentioning: in cases where |
5c44542
to
0b5a9e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though CI is hitting https://github.com/coreos/fedora-coreos-config/issues/591
It's possible that `fetch-offline` does successfully fetch and cache a config but still touch `/run/ignition/neednet`. That stamp file is an API between Ignition and the OS that Ignition will need networking to fully process it. But the config itself might've successfully been fetched (and the only thing that requires networking is e.g. a remote file). In those cases, there's no point in running `fetch` and have it query the provider again.
0b5a9e5
to
ad76955
Compare
Right now, even if
fetch-offline
getsErrNeedNet
, it might've stilllogged info about configs which it did fetch before hitting the error.
This then results in double-logging of e.g. the base config and at least
the first layer of user configs when
fetch
re-fetches them.But it's also misleading, because anything which runs between
fetch-offline
andfetch
and sees the journal messages will thinkthat Ignition did successfully fetch and cache the merged user config,
when it did not.
And sadly, we still have code which peek at the cached config for
$reasons
(legacy-style RHCOS LUKS is one of them, RHCOS FIPS supportis another), and those bits get thrown off by seeing the logging
messages yet not seeing a cached Ignition config.
Let's tweak things so that we buffer those messages and only actually
write them out once we've successfully acquired the configs.
While we're here, clean up the base config logging hack now that the
fetch
stages are canonical.