Liran Zelkha has uploaded a new change for review. Change subject: core: VdsNotRespondingTreatment Job is not marked as finished. ......................................................................
core: VdsNotRespondingTreatment Job is not marked as finished. Once a host is not reachable and VdsNotRespondingTreatment job runs, the job is always marked as STARTED - never FINISHED/FAILS. This patch solves this Change-Id: I9d3d6bc9f409bbcdd5a6b7d2201d8d6eef61ecf5 Bug-Url: https://bugzilla.redhat.com/1075500 Signed-off-by: [email protected] <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/58/26058/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java index 97f024a..ddd96cf 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java @@ -3,6 +3,8 @@ import java.util.HashMap; import java.util.Map; +import org.apache.commons.lang.ObjectUtils; +import org.ovirt.engine.core.bll.job.ExecutionContext; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.VdcObjectType; import org.ovirt.engine.core.common.action.FenceVdsActionParameters; @@ -62,7 +64,12 @@ boolean shouldBeFenced = validator.shouldVdsBeFenced(); if (shouldBeFenced) { getParameters().setParentCommand(VdcActionType.VdsNotRespondingTreatment); + // Make sure that the StopVdsCommand that runs by the RestartVds + // don't write over our job, and disrupt marking the job status correctly + ExecutionContext ec = (ExecutionContext) ObjectUtils.clone(this.getExecutionContext()); + ec.setJob(this.getExecutionContext().getJob()); super.executeCommand(); + this.setExecutionContext(ec); } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", -- To view, visit http://gerrit.ovirt.org/26058 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d3d6bc9f409bbcdd5a6b7d2201d8d6eef61ecf5 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.4 Gerrit-Owner: Liran Zelkha <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
