Hi All,
I saw couple of threads mentioning NO_HANDLERS error but can't see resolution, we are running 12 nodes vert.x(3.3.3) cluster in linux.
Every now and then we are getting NO_HANDLERS errors for random calls, even though the node is running and some calls are working.
After restarting the node which has handler it all seems to be working. we are running all nodes in embedded mode, can anyone please shed some light on why this could be happening?
My be we are missing come config at vert.x level, or operating server level. We used to get this error with vert.x 2 but not as often as we are getting it now.
Thanks,
Vinay
Following method is used to start embedded vert.x:
public void start(String host, int port, String vertxDomain) {
ClusterManager mgr = new HazelcastClusterManager();
VertxOptions vertxOptions = new VertxOptions();
vertxOptions.setClustered(true);
String thisHostName = getDefaultAddress();
vertxOptions.setClusterHost(thisHostName);
vertxOptions.setClusterPort(port);
vertxOptions.setWorkerPoolSize(100);
vertxOptions.setMetricsOptions(
new DropwizardMetricsOptions().setJmxEnabled(true).setJmxDomain(host + "-" + vertxDomain + "-" + port)
.addMonitoredEventBusHandler(new Match().setValue(".*").setType(MatchType.REGEX)));
System.out.println("Starting vert.x for " + vertxDomain);
Vertx.clusteredVertx(vertxOptions, res -> {
if (res.succeeded()) {
vx = res.result();
vertxstarted.set(true);
System.out.println("Vertx initialised for : " + vertxDomain + vx);
} else {
System.out.println("Vertx initialisation failed: for " + vertxDomain + res.cause());
vertxstarted.set(false);
}
});
synchronized (vertxstarted) {
try {
while (false == vertxstarted.get()) {
System.out.println("waiting for vert.x to start ....." + vertxDomain);
Thread.sleep(1000);
}
} catch (Exception e) {
System.out.println("ERROR while waiting for vert.x to start ....." + vertxDomain);
e.printStackTrace(System.out);
}
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("vert.x started for " + vertxDomain);
// registerExitHandler(pm);
}
and this is to deployment:
public void deployVerticle(boolean worker, boolean multiThreaded, int instances, JsonObject config, String main) {
AtomicBoolean verticleDeployed = new AtomicBoolean(false);
System.out.print("deploying " + main + "....");
DeploymentOptions options = new DeploymentOptions();
if (multiThreaded) {
options.setMultiThreaded(multiThreaded);
}
if (worker) {
options.setWorker(worker);
}
options.setInstances(instances);
if (!config.isEmpty()) {
options.setConfig(config);
}
System.out.println("Start deploying verticle: " + main);
Consumer<Vertx> runner = vertx -> {
try {
vertx.deployVerticle(main, options, res -> {
if (res.succeeded()) {
String verticleDeploymentId = res.result();
verticleDeployed.set(true);
System.out.println(main + " Verticle deployed successfully");
} else {
System.out.println(main + " Verticle deployed failed");
verticleDeployed.set(false);
}
});
} catch (Throwable t) {
System.out.println(main + " Verticle deployment failed: " + t);
t.printStackTrace();
}
};
runner.accept(vx);
synchronized (verticleDeployed) {
try {
while (false == verticleDeployed.get()) {
System.out.println(main + " waiting for verticle deployment to finish");
Thread.sleep(1000);
}
} catch (Exception e) {
System.out.println(main + "ERROR while waiting for verticle deployment to start .....");
e.printStackTrace(System.out);
}
}
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("End deploying verticle: " + main);
}