airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject airavata git commit: fixing error during recovery
Date Sat, 25 Apr 2015 23:59:54 GMT
Repository: airavata
Updated Branches:
  refs/heads/master d08415a53 -> 8baaa0c61


fixing error during recovery


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/8baaa0c6
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/8baaa0c6
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/8baaa0c6

Branch: refs/heads/master
Commit: 8baaa0c6146ff46738bea845918de80a6bdf1d34
Parents: d08415a
Author: Lahiru Gunathilake <glahiru@gmail.com>
Authored: Sat Apr 25 19:59:46 2015 -0400
Committer: Lahiru Gunathilake <glahiru@gmail.com>
Committed: Sat Apr 25 19:59:46 2015 -0400

----------------------------------------------------------------------
 .../AiravataExperimentStatusUpdator.java        | 28 +++++++++++---------
 .../airavata/common/utils/AiravataZKUtils.java  |  6 ++---
 2 files changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/8baaa0c6/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
index 6341ed8..a477fd6 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
@@ -129,21 +129,23 @@ public class AiravataExperimentStatusUpdator implements AbstractActivityListener
 
     private void cleanup(WorkflowNodeStatusChangeEvent nodeStatus, String experimentNode,
String experimentPath) throws KeeperException, InterruptedException, AiravataException {
         int count = 0;
-        long deliveryTag = AiravataZKUtils.getDeliveryTag(nodeStatus.getWorkflowNodeIdentity().getExperimentId(),
zk, experimentNode, ServerSettings.getSetting(Constants.ZOOKEEPER_GFAC_SERVER_NAME));
-        if (ServerSettings.isGFacPassiveMode()) {
-            while (!consumer.isOpen() && count < 3) {
-                try {
-                    consumer.reconnect();
-                } catch (AiravataException e) {
-                    count++;
+        long deliv  eryTag = AiravataZKUtils.getDeliveryTag(nodeStatus.getWorkflowNodeIdentity().getExperimentId(),
zk, experimentNode, ServerSettings.getSetting(Constants.ZOOKEEPER_GFAC_SERVER_NAME));
+        if(deliveryTag>0) {
+            if (ServerSettings.isGFacPassiveMode()) {
+                while (!consumer.isOpen() && count < 3) {
+                    try {
+                        consumer.reconnect();
+                    } catch (AiravataException e) {
+                        count++;
+                    }
                 }
-            }
-            try {
-                if (consumer.isOpen()) {
-                    consumer.sendAck(deliveryTag);
+                try {
+                    if (consumer.isOpen()) {
+                        consumer.sendAck(deliveryTag);
+                    }
+                } catch (Exception e) {
+                    logger.error("Error sending the Ack ! If the worker pick this again airavata
should gracefully handle !");
                 }
-            }catch (Exception e){
-                logger.error("Error sending the Ack ! If the worker pick this again airavata
should gracefully handle !");
             }
         }
         if (zk.exists(experimentPath + AiravataZKUtils.DELIVERY_TAG_POSTFIX, false) != null)
{

http://git-wip-us.apache.org/repos/asf/airavata/blob/8baaa0c6/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AiravataZKUtils.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AiravataZKUtils.java
b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AiravataZKUtils.java
index 92364cc..3a38ba1 100644
--- a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AiravataZKUtils.java
+++ b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AiravataZKUtils.java
@@ -203,12 +203,12 @@ public class AiravataZKUtils implements Watcher {
 
     public static long getDeliveryTag(String experimentID, ZooKeeper zk, String experimentNode,
                                       String pickedChild) throws KeeperException, InterruptedException,AiravataException
{
-        String experimentPath = experimentNode + File.separator + pickedChild;
-        String deliveryTagPath = experimentPath + File.separator + experimentID
+        String deliveryTagPath = experimentNode + File.separator + pickedChild + File.separator
+ experimentID
                 + DELIVERY_TAG_POSTFIX;
         Stat exists = zk.exists(deliveryTagPath, false);
         if(exists==null) {
-            throw new AiravataException("Cannot find delivery Tag for this experiment");
+            logger.error("Cannot find delivery Tag in path:" + deliveryTagPath + " for this
experiment");
+            return -1;
         }
         return bytesToLong(zk.getData(deliveryTagPath, false, exists));
     }


Mime
View raw message