airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject [1/2] git commit: Fixing zk reconnection issue, this will be useful during debugging
Date Wed, 17 Sep 2014 17:56:00 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 024fc5d77 -> c65389506


Fixing zk reconnection issue, this will be useful during debugging


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

Branch: refs/heads/master
Commit: 2a55d83895986e4cfac5ed3a06f39e1b2ab7b00f
Parents: d7bb140
Author: lahiru <lahiru@apache.org>
Authored: Wed Sep 17 13:55:42 2014 -0400
Committer: lahiru <lahiru@apache.org>
Committed: Wed Sep 17 13:55:42 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gfac/server/GfacServerHandler.java  | 3 +++
 .../gfac/monitor/impl/push/amqp/SimpleJobFinishConsumer.java     | 4 ++--
 .../airavata/orchestrator/server/OrchestratorServerHandler.java  | 3 +++
 3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2a55d838/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
index 6573e19..1b9eb75 100644
--- a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
+++ b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
@@ -146,6 +146,9 @@ public class GfacServerHandler implements GfacService.Iface, Watcher{
                     state == Event.KeeperState.Disconnected){
                 try {
                     zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(),6000,this);
+                    synchronized(mutex){
+                        mutex.wait();  // waiting for the syncConnected event
+                    }
                     storeServerConfig();
                 } catch (IOException e) {
                     e.printStackTrace();

http://git-wip-us.apache.org/repos/asf/airavata/blob/2a55d838/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/SimpleJobFinishConsumer.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/SimpleJobFinishConsumer.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/SimpleJobFinishConsumer.java
index 2a3f360..64d241e 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/SimpleJobFinishConsumer.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/SimpleJobFinishConsumer.java
@@ -54,7 +54,7 @@ public class SimpleJobFinishConsumer {
 
             ch.queueDeclare(queueName, false, false, false, null);
 
-            logger.info("--------Declare the queue " + queueName + "the channel with Rabbitmq
server successfully-------");
+            logger.info("--------Declare the queue " + queueName + " in Rabbitmq server successfully-------");
 
             final QueueingConsumer consumer = new QueueingConsumer(ch);
             ch.basicConsume(queueName, consumer);
@@ -63,7 +63,7 @@ public class SimpleJobFinishConsumer {
                     try {
                         while (true) {
                             QueueingConsumer.Delivery delivery = consumer.nextDelivery();
-                            System.out.println(new String(delivery.getBody()));
+                            logger.info("---------------- Job Finish message received:"+new
String(delivery.getBody())+" --------------");
                             completedJobsFromPush.add(new String(delivery.getBody()));
                             ch.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
                         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/2a55d838/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index c1a00a8..e6678d3 100644
--- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -300,6 +300,9 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface,
                 case Expired:case Disconnected:
                         try {
                             zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), 6000, this);
+                            synchronized (mutex) {
+                                mutex.wait(); // waiting for the syncConnected event
+                            }
                             String airavataServerHostPort = ServerSettings
                                     .getSetting(Constants.ORCHESTRATOR_SERVER_HOST)
                                     + ":"


Mime
View raw message