diff src/main/java/alice/topology/manager/keeparive/RemoveTask.java @ 498:e5d2141af6c2 dispose

keep alive Scheduler has bug
author sugi
date Mon, 15 Dec 2014 19:16:20 +0900
parents aefbe41fcf12
children c5072a63b257
line wrap: on
line diff
--- a/src/main/java/alice/topology/manager/keeparive/RemoveTask.java	Mon Dec 15 16:41:08 2014 +0900
+++ b/src/main/java/alice/topology/manager/keeparive/RemoveTask.java	Mon Dec 15 19:16:20 2014 +0900
@@ -18,15 +18,19 @@
         ListManager list = info1.asClass(ListManager.class); // explicit cast
         TaskInfo task = info2.asClass(TaskInfo.class);
         TaskExecuter exec = TaskExecuter.getInstance();
-        if (exec.compareNowTask(task)){
-            // case: remove task is state countdown.
-            exec.skip();
-        } else {
+        if (!exec.compareAndSkip(task)){
             // case: remove task is still in the waiting queue.
             boolean removeFlag = list.deleteTask(task);
             if (!removeFlag){
+                System.out.println("falied RemoveTask "+task.getManagerKey());
                 ods.put("_REMOVETASK", task);
+            } else {
+                System.out.println("success RemoveTask "+task.getManagerKey());
+                //list.show();
             }
+        } else {
+            System.out.println("success RemoveTask "+task.getManagerKey());
+            //list.show();
         }
         ods.update("_WAITINGLIST", list);
     }