Hi Raj, LB cluster monitor should be added in less than 1 minute.
If we are to improve this, we need to check, AutoscalerContext.getInstance().clusterMonitorExist(lbClusterId) We may find the LB cluster id with some effort. So waiting a minute or so would be efficient. Thanks. On Wed, Oct 1, 2014 at 8:44 PM, Rajkumar Rajaratnam <[email protected]> wrote: > Hi, > > *org.apache.stratos.autoscaler.monitor.VMServiceClusterMonitor.run();* > > https://github.com/apache/stratos/blob/master/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/VMServiceClusterMonitor.java > > > @Override > public void run() { > > * try {* > * // TODO make this configurable,* > * // this is the delay the min check of normal cluster monitor > to wait until LB monitor is added* > * Thread.sleep(60000);* > * } catch (InterruptedException ignore) {* > * }* > > while (!isDestroyed()) { > if (log.isDebugEnabled()) { > log.debug("VMServiceClusterMonitor is running.. " + > this.toString()); > } > try { > if(!ClusterStatus.In_Maintenance.equals(getStatus())) { > monitor(); > } else { > if (log.isDebugEnabled()) { > log.debug("VMServiceClusterMonitor is suspended as > the cluster is in " + > ClusterStatus.In_Maintenance + " > mode......"); > } > } > } catch (Exception e) { > log.error("VMServiceClusterMonitor : Monitor failed." + > this.toString(), e); > } > try { > Thread.sleep(getMonitorInterval()); > } catch (InterruptedException ignore) { > } > } > } > > Can anyone clarify why we are doing this delay? How we can say that > LbClusterMonitor is added in 1 min? > > Thanks. > > -- > Rajkumar Rajaratnam > Software Engineer | WSO2, Inc. > Mobile +94777568639 | +94783498120 > -- -- Lahiru Sandaruwan Committer and PMC member, Apache Stratos, Senior Software Engineer, WSO2 Inc., http://wso2.com lean.enterprise.middleware email: [email protected] cell: (+94) 773 325 954 blog: http://lahiruwrites.blogspot.com/ twitter: http://twitter.com/lahirus linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146
