Kanagaraj M has uploaded a new change for review.

Change subject: gluster: fix releasing lock in task sync-job
......................................................................

gluster: fix releasing lock in task sync-job

When a remove-brick start is CLI and
engine detects it and creates a job for it.
A lock is  acquired for the volume, and released.

Now the lock won't be released, the same will be
released when the task is completed.

Change-Id: Ib1934bfa976456949a475f6675866bbd083185f4
Bug-Url: https://bugzilla.redhat.com/1061677
Signed-off-by: Kanagaraj M <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterTasksSyncJob.java
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/54/24154/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterTasksSyncJob.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterTasksSyncJob.java
index 9e9b3f7..5042472 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterTasksSyncJob.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterTasksSyncJob.java
@@ -249,11 +249,11 @@
             logTaskStartedFromCLI(cluster, task, vol);
         } catch (Exception e) {
             log.error(e);
-            throw new VdcBLLException(VdcBllErrors.GeneralException, 
e.getMessage());
-        } finally {
+            // Release the lock only if there is any exception,
+            // otherwise the lock will be released once the task is completed
             releaseLock(vol.getId());
+            throw new VdcBLLException(VdcBllErrors.GeneralException, 
e.getMessage());
         }
-
     }
 
     private void logTaskStartedFromCLI(VDSGroup cluster, GlusterAsyncTask 
task, GlusterVolumeEntity vol) {


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

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

Reply via email to