[grid] Ensure a second node is able to register itself
@@ -252,8 +252,14 @@ private void register(NodeStatus status) {
public LocalDistributor add(Node node) {
Require.nonNull("Node", node);
- nodes.put(node.getId(), node);
+ // An exception occurs if Node heartbeat has started but the server is not ready.
+ // Unhandled exception blocks the event-bus thread from processing any event henceforth.
+ try {
model.add(node.getStatus());
+ nodes.put(node.getId(), node);
+ } catch (Exception e){
+ return this;
+ }
// Extract the health check
Runnable runnableHealthCheck = asRunnableHealthCheck(node);
