OCPEDGE-2826: fix fencing_validator ocdebug fence dispatch race condition - #6341
Conversation
The fence() function's compound command for the ocdebug transport used `A && B || C & disown`, where the `& disown` was intended only for the nohup fallback (C). However, bash parses `&` as a list terminator that backgrounds the entire AND-OR list, not just the last pipeline. This caused the oc debug pod to exit immediately after backgrounding the compound command, and pod cleanup killed the systemd-run process before it could dispatch the fence unit to systemd. The fence never happened but the script saw exit 0. Replace the `&&/||` compound with an explicit if/else so that `& disown` is correctly scoped to only the nohup fallback branch. Also switch to `--no-block` for systemd-run so it returns immediately after dispatching the unit, avoiding any timeout interaction with the oc debug session. Tested on a live TNF cluster: the patched script successfully fences both nodes sequentially and completes the full disruptive validation, whereas the unpatched script times out waiting for the first node to become NotReady. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
WalkthroughThe fencing validator’s ocdebug transport now explicitly checks for ChangesFencing dispatch
Estimated code review effort: 2 (Simple) | ~5 minutes Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@templates/master/00-master/two-node-with-fencing/files/fencing-validator.yaml`:
- Around line 474-476: Update the systemd-run invocation in the fencing command
within the host_run block to retain the --collect option alongside --no-block
and the existing fence-$t unit name. Preserve the fallback nohup behavior
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 703147ed-cb9f-459d-a5d0-2c71adbc6ecd
📒 Files selected for processing (1)
templates/master/00-master/two-node-with-fencing/files/fencing-validator.yaml
|
/test ? |
Without --collect, a failed or completed transient unit stays loaded and a subsequent fence attempt for the same target would fail because the unit name already exists. Adding --collect alongside --no-block ensures the unit is garbage-collected after completion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@coderabbitai resolve |
✅ Action performedComments resolved. Approval is disabled; enable |
|
Scheduling tests matching the |
isabella-janssen
left a comment
There was a problem hiding this comment.
/lgtm
Deferring to TNF team's LGTM as this impacts them.
|
/retitle NO-ISSUE: fix fencing_validator ocdebug fence dispatch race condition |
|
@Neilhamza: This pull request explicitly references no jira issue. 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: fracappa, isabella-janssen, Neilhamza 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 |
|
/retest-required |
|
/retest |
|
/test ci/prow/e2e-aws-ovn |
|
/test e2e-aws-ovn |
|
/verified by ci |
|
@Neilhamza: 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. |
|
@Neilhamza: 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. |
|
/cherry-pick release-4.22 |
|
@Neilhamza: new pull request created: #6360 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 kubernetes-sigs/prow repository. |
|
/cherry-pick release-4.22 |
|
@Neilhamza: new pull request could not be created: failed to create pull request against openshift/machine-config-operator#release-4.22 from head openshift-cherrypick-robot:cherry-pick-6341-to-release-4.22: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for openshift-cherrypick-robot:cherry-pick-6341-to-release-4.22."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"} 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 kubernetes-sigs/prow repository. |
Summary
Fixes the
fence()function in the fencing_validator script for theocdebugtransport mode. The fence command was silently failing due to a bash parsing issue, causing the disruptive fencing validation CI lane to time out on 4.22, 4.23, and 5.0.Root cause: The compound command
A && B || C & disownbackgrounds the entire AND-OR list (not just thenohupfallback), causing theoc debugpod to exit immediately and kill thesystemd-runprocess before it dispatches the fence unit.Fix: Replace
&&/||withif/elseto scope& disownto only the nohup fallback, and use--no-blockonsystemd-run.Failing CI lanes
periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-validationperiodic-ci-openshift-release-main-nightly-4.23-e2e-metal-ovn-two-node-fencing-validationperiodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-validationExample failure: https://prow.ci.openshift.org/view/gs/test-platform-results/logs/periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-validation/2081600945665347584
Jira: https://redhat.atlassian.net/browse/OCPEDGE-2826
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
systemd-run.systemd-runwith non-blocking behavior and a dedicated unit name.pcs stonith fencein the background.