Arik Hadas has uploaded a new change for review.

Change subject: core: fix for locks not being released in sync commands
......................................................................

core: fix for locks not being released in sync commands

This patch fix the following problem: when acquiring locks inside
a command which is synchronous and set to not release its locks after
the 'execute' method, the locks remain forever since the end-action
is not going to be called.

The solution is to release the locks at the end of the 'execute' method
if the command has no tasks.

Change-Id: I8f39b924327fb0a8e1081ca9bde6b24f489a7c1e
Signed-off-by: Arik Hadas <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/87/15887/1

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 903af76..4ae4866 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
@@ -1574,7 +1574,7 @@
     }
 
     private void freeLockExecute() {
-        if (releaseLocksAtEndOfExecute || !getSucceeded()) {
+        if (releaseLocksAtEndOfExecute || !getSucceeded() || !hasTasks()) {
             freeLock();
         }
     }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f39b924327fb0a8e1081ca9bde6b24f489a7c1e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to