You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently had an incident where an old version of a daemon was running in memory while the new version had been installed on disk (during an OS patch run). This was odd to me, because we configure all of our OS patch jobs with RebootConfig = always (https://cloud.google.com/compute/docs/osconfig/rest/v1/PatchConfig#rebootconfig):
ALWAYS: Always reboot the machine after the update completes.
You can see what's happening here: the system has the need restart/reboot flag set (the OS managed one), so before the OS patching the system is rebooted. The system comes back, and performs the requested patching operation (two packages installed). After, the OS flag for requiring a reboot is not set -- which is fine, these packages are not kernel (and friends) updates so don't set that flag.
There is no reboot after the instance is patched.
My expectation based on the GCP docs for our OS patch job configuration is that the instance must ALWAYS be rebooted post-patch.
I'm struggling with r.RebootCount == 0 here -- it seems like if prior to patching the system indicated a reboot was required, one was performed (which sets RebootCount += 1), and then during a post-patch reboot check, even if the reboot flag is set to always the system won't be rebooted. Either the documentation is wrong (in which case I am wondering how we configure patching to always reboot), or the logic here should more appropriately be:
We recently had an incident where an old version of a daemon was running in memory while the new version had been installed on disk (during an OS patch run). This was odd to me, because we configure all of our OS patch jobs with
RebootConfig = always
(https://cloud.google.com/compute/docs/osconfig/rest/v1/PatchConfig#rebootconfig):Here's the transcript of
OSConfigAgent
:You can see what's happening here: the system has the need restart/reboot flag set (the OS managed one), so before the OS patching the system is rebooted. The system comes back, and performs the requested patching operation (two packages installed). After, the OS flag for requiring a reboot is not set -- which is fine, these packages are not kernel (and friends) updates so don't set that flag.
There is no reboot after the instance is patched.
My expectation based on the GCP docs for our OS patch job configuration is that the instance must ALWAYS be rebooted post-patch.
The problem appears to be with the logic here:
osconfig/agentendpoint/patch_task.go
Line 170 in c232087
I'm struggling with
r.RebootCount == 0
here -- it seems like if prior to patching the system indicated a reboot was required, one was performed (which setsRebootCount += 1
), and then during a post-patch reboot check, even if the reboot flag is set to always the system won't be rebooted. Either the documentation is wrong (in which case I am wondering how we configure patching to always reboot), or the logic here should more appropriately be:(ie, it should not consider if a reboot was already performed).
Steps to Reproduce
RebootConfig = always
/var/run/reboot-required
on Linux)The text was updated successfully, but these errors were encountered: