Maor Lipchuk has uploaded a new change for review.

Change subject: core[WIP]:Lost tasks will become unknown in engine.
......................................................................

core[WIP]:Lost tasks will become unknown in engine.

When VDSM looses tasks, engine should be more fault tolerant, and
remove those tasks from the tasks list.

Lost tasks cause the VMs to be locked for a long time (until they become zombie
tasks and gets cleaned).

VDSM obligates that tasks can't re appear after SPM gets elected, so
there is no reason to keep those tasks running, and we can assure that
engine should not encounter "new" tasks that were lost before from the
SPM.

This patch is WIP until it will be verify by pre integration team.

Change-Id: I0dc295e71850a7d13aed3449dbf92c6b0ae952ba
Signed-off-by: Maor Lipchuk <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SPMAsyncTask.java
1 file changed, 8 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/57/7757/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SPMAsyncTask.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SPMAsyncTask.java
index 1ace7e2..9a7fef8 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SPMAsyncTask.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SPMAsyncTask.java
@@ -306,13 +306,8 @@
 
     /**
      * Print log message, Checks if the cachedStatusTask is null, (indicating 
the task was not found in the SPM).
-     * If so returns {@link AsyncTaskStatusEnum#running} status, otherwise 
returns the status as given.<br>
+     * If so returns {@link AsyncTaskStatusEnum#unknown} status, otherwise 
returns the status as given.<br>
      * <br>
-     * <b>Note:</b> The task is returned as running since we need to support a 
case where there is a change of SPM,
-     * or the SPM is just recovering from crash, and the SPM might return that 
it doesn't know that this task exists,
-     * but in actuality it exists. If in this case {@link 
AsyncTaskStatusEnum#unknown} is returned then the task
-     * will become a permanent zombie task since it won't be polled, so take 
notice if you ever want to change this
-     * behavior.
      *
      * @param cachedStatusTask The status from the SPM, or <code>null</code> 
is the task wasn't found in the SPM.
      * @return - Updated status task
@@ -322,15 +317,13 @@
 
         // If the cachedStatusTask is null ,that means the task has not been 
found in the SPM.
         if (cachedStatusTask == null) {
-            // Set to running in order to continue polling the task in case 
SPM hasn't loaded the tasks yet..
-            returnedStatusTask = new 
AsyncTaskStatus(AsyncTaskStatusEnum.running);
-
-            if (getLastTaskStatus().getStatus() != 
returnedStatusTask.getStatus()) {
-                log.errorFormat("SPMAsyncTask::PollTask: Task '{0}' (Parent 
Command {1}, Parameters Type {2}) " +
-                        "was not found in VDSM, will change its status to 
running.",
-                        getTaskID(), 
(getParameters().getDbAsyncTask().getaction_type()),
-                        getParameters().getClass().getName());
-            }
+             // Set task to unknown, when not returned from VDSM.
+            returnedStatusTask = new AsyncTaskStatus(
+                    AsyncTaskStatusEnum.unknown);
+            log.errorFormat("Task '{0}' (Parent Command {1}, Parameters Type 
{2}) " +
+                    "was not found in VDSM, will change its status to 
unknown.",
+                    getTaskID(), 
(getParameters().getDbAsyncTask().getaction_type()),
+                    getParameters().getClass().getName());
         } else {
             returnedStatusTask = cachedStatusTask;
         }


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

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

Reply via email to