[release-4.22] USHIFT-7342: Replace hardcoded sleep with state check before restart#7043
Conversation
The Restart MicroShift keyword had an unconditional 10s sleep before every restart to avoid issuing restarts while the service was mid-transition. Replace it with an active check that polls systemd ActiveState for transitional states, passing instantly when the service is already stable and saving ~10s per restart. Also reset the systemd failure counter before restarting so that start-limit-hit from prior rapid failures (e.g. invalid config tests) does not block the restart.
The transition check budget (10x 5s = 50s) was too short — the activating state can last up to TimeoutStartSec=4m (240s) during slow startups. Increase to 30x 10s (300s) to cover the full startup window, matching the poll interval used by every other wait in the file. Reduce Wait For MicroShift Service from 50x 10s (500s) to 30x 10s (300s). TimeoutStartSec=4m (240s) is the hard ceiling — systemd kills the process after that, so the extra 200s could never fire. All waits in the file now use a uniform 30x 10s (300s) budget. Document the full Restart MicroShift flow: the Restart=always auto-restart loop, why the transition check must precede reset-failed (to close the race where pending auto-restarts re-trigger start-limit-hit after we clear it), PID tracking as defense-in-depth, and the readiness verification sequence.
|
@openshift-cherrypick-robot: Ignoring requests to cherry-pick non-bug issues: USHIFT-7342 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@openshift-cherrypick-robot: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/lgtm |
|
@ggiguash: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ggiguash, openshift-cherrypick-robot The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5938365
into
openshift:release-4.22
This is an automated cherry-pick of #6996
/assign pacevedom