Martin Peřina has uploaded a new change for review.

Change subject: core: Fixes StackOverflowError during fencing
......................................................................

core: Fixes StackOverflowError during fencing

Fixes StackOverflowError appeared during execution of fencing operation.
This fix removes commandContex instance and overriden getContext() from
RestartVdsCommand, because command context in CommandBase should be set
always during creation of command and successful locks aquiring is
checked prior to executeCommand call in CommandBase.

Also when RestartVdsCommand and its inherited commands are using global
command context, VdsKdumpDetection command executed from
VdsNotRespondingTreatmentCommand should also use global command context
and not its copy.

The overriden getContext() has been introduced in
Iaf021010188e3c3662fbf8a057da4c58f2600c02.

Change-Id: Icbe5ad9194b19a390f45c99198087a9e5b68eb9c
Bug-Url: https://bugzilla.redhat.com/1124141
Signed-off-by: Martin Perina <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsKdumpDetectionCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java
3 files changed, 2 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/06/30906/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
index be63dc6..d1dceb29 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
@@ -25,7 +25,6 @@
 import 
org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters;
 import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
 import org.ovirt.engine.core.compat.Guid;
-import org.ovirt.engine.core.utils.lock.EngineLock;
 
 /**
  * Send a Stop followed by Start action to a power management device.
@@ -44,8 +43,6 @@
  */
 @NonTransactiveCommandAttribute
 public class RestartVdsCommand<T extends FenceVdsActionParameters> extends 
FenceVdsBaseCommand<T> {
-
-    private CommandContext commandContext;
 
     protected List<VM> getVmList() {
         return mVmList;
@@ -134,13 +131,6 @@
             params.setChangeHostToMaintenanceOnStart(true);
         }
         return runInternalAction(action, params, getContext());
-    }
-
-    public CommandContext getContext() {
-        if (commandContext == null) {
-            commandContext = cloneContext().withLock(new 
EngineLock(getExclusiveLocks(), null));
-        }
-        return commandContext;
     }
 
     @Override
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsKdumpDetectionCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsKdumpDetectionCommand.java
index daf25af..df54924 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsKdumpDetectionCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsKdumpDetectionCommand.java
@@ -25,7 +25,6 @@
 import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector;
 import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase;
 import org.ovirt.engine.core.utils.ThreadUtils;
-import org.ovirt.engine.core.utils.lock.EngineLock;
 
 /**
  * Tries to detect if host is kdumping.
@@ -103,9 +102,7 @@
         runInternalAction(
                 VdcActionType.FenceVdsManualy,
                 fenceVdsManuallyParams,
-                cloneContext()
-                        .withoutCompensationContext()
-                        .withLock(new EngineLock(getExclusiveLocks(), null)));
+                getContext());
     }
 
     private KdumpDetectionResult detectHostKdumping() {
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 b2a9de4..8b42d2a 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
@@ -6,7 +6,6 @@
 import org.apache.commons.lang.ObjectUtils;
 import org.ovirt.engine.core.bll.context.CommandContext;
 import org.ovirt.engine.core.bll.job.ExecutionContext;
-import org.ovirt.engine.core.bll.job.ExecutionHandler;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.FenceVdsActionParameters;
@@ -74,7 +73,7 @@
             VdcReturnValueBase retVal =
                     runInternalAction(VdcActionType.VdsKdumpDetection,
                             getParameters(),
-                            
ExecutionHandler.createInternalJobContext(getContext()));
+                            getContext());
 
             if (retVal.getSucceeded()) {
                 // kdump on host detected and finished successfully, stop hard 
fencing execution


-- 
To view, visit http://gerrit.ovirt.org/30906
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbe5ad9194b19a390f45c99198087a9e5b68eb9c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Martin Peřina <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to