abdullah alamoudi has submitted this change and it was merged.

Change subject: This change fixes the sporadic connection refused errors after 
managix starts up an Asterix instance. This can mostly be seen during 
asterix-installer tests. The fix basically lets managix wait and listens 
through zookeeper for a signal from the cluster c
......................................................................


This change fixes the sporadic connection refused errors after managix starts 
up an Asterix instance. This can mostly be seen during asterix-installer tests.
The fix basically lets managix wait and listens through zookeeper for a signal 
from the cluster controller. Once the cluster controller sends the signal, 
Managix can proceed.

Change-Id: I0975308e1dc2650d8c2e50d58ff2c696b22eaaa4
Reviewed-on: https://asterix-gerrit.ics.uci.edu/365
Tested-by: Jenkins <[email protected]>
Reviewed-by: Till Westmann <[email protected]>
---
M 
hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/ICCApplicationEntryPoint.java
M 
hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
2 files changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Till Westmann: Looks good to me, approved
  Jenkins: Verified



diff --git 
a/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/ICCApplicationEntryPoint.java
 
b/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/ICCApplicationEntryPoint.java
index e47b550..1903a4b 100644
--- 
a/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/ICCApplicationEntryPoint.java
+++ 
b/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/application/ICCApplicationEntryPoint.java
@@ -22,4 +22,6 @@
     public void start(ICCApplicationContext ccAppCtx, String[] args) throws 
Exception;
 
     public void stop() throws Exception;
+
+    void startupCompleted() throws Exception;
 }
\ No newline at end of file
diff --git 
a/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
 
b/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
index f2f450d..e311903 100644
--- 
a/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
+++ 
b/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
@@ -153,6 +153,8 @@
 
     private ShutdownRun shutdownCallback;
 
+    private ICCApplicationEntryPoint aep;
+
     public ClusterControllerService(final CCConfig ccConfig) throws Exception {
         this.ccConfig = ccConfig;
         File jobLogFolder = new File(ccConfig.ccRoot, "logs/jobs");
@@ -243,6 +245,10 @@
         datasetDirectoryService.init(executor);
         workQueue.start();
         LOGGER.log(Level.INFO, "Started ClusterControllerService");
+        if (aep != null) {
+            // Sometimes, there is no application entry point. Check 
hyracks-client project
+            aep.startupCompleted();
+        }
     }
 
     private void startApplication() throws Exception {
@@ -251,7 +257,7 @@
         String className = ccConfig.appCCMainClass;
         if (className != null) {
             Class<?> c = Class.forName(className);
-            ICCApplicationEntryPoint aep = (ICCApplicationEntryPoint) 
c.newInstance();
+            aep = (ICCApplicationEntryPoint) c.newInstance();
             String[] args = ccConfig.appArgs == null ? null : 
ccConfig.appArgs.toArray(new String[ccConfig.appArgs
                     .size()]);
             aep.start(appCtx, args);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/365
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0975308e1dc2650d8c2e50d58ff2c696b22eaaa4
Gerrit-PatchSet: 5
Gerrit-Project: hyracks
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <[email protected]>
Gerrit-Reviewer: Chris Hillery <[email protected]>
Gerrit-Reviewer: Ian Maxon <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Till Westmann <[email protected]>
Gerrit-Reviewer: abdullah alamoudi <[email protected]>

Reply via email to