Eldan Shachar has uploaded a new change for review. Change subject: core: Fix AddVmTemplate unreleased lock ......................................................................
core: Fix AddVmTemplate unreleased lock AddVmTemplate child command caused a lock lost in some conditions, the problem occurred because the child command got the parent command context instead of a clone, when the child command cleared the lock (before it started the execution) it caused the parent command to lose that lock as well. The clone creation was missing in CommandBase::insertAsyncTaskPlaceHolders(), because this mechanism was removed in 3.6, and because the current problem seems to only affect addVmTemplate, this fix is local only to AddVmTemplate so changes for the infrastructure are minimal. Change-Id: I3e1f0c04094866bf0bb7b36a6e166280939a2d8c Bug-Url: https://bugzilla.redhat.com/1203307 Signed-off-by: Eldan Shachar <eshac...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java 2 files changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/68/39768/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java index a722a04..fde0859 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java @@ -926,4 +926,9 @@ return validate(CpuProfileHelper.setAndValidateCpuProfile(getParameters().getMasterVm(), getVdsGroup().getcompatibility_version())); } + + @Override + protected CommandContext getChildCommandContext() { + return cloneContext(); + } } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java index 85cf613..2e02a75 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java @@ -1389,6 +1389,10 @@ return annotation != null && annotation.forceCompensation(); } + protected CommandContext getChildCommandContext() { + return context; + } + /** * This method is called before executeAction to insert the async task * placeholders for the child commands. @@ -1403,7 +1407,7 @@ CommandBase<?> command = BackendUtils.getBackendCommandObjectsHandler(log).createAction(entry.getValue().getFirst(), entry.getValue().getSecond(), - context); + getChildCommandContext()); log.infoFormat("Command {0} persisting async task placeholder for child command {1}", getCommandId(), command.getCommandId()); -- To view, visit https://gerrit.ovirt.org/39768 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e1f0c04094866bf0bb7b36a6e166280939a2d8c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eldan Shachar <eshac...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches