Skip to content

Commit a4c3e3b

Browse files
committed
[grid] Ensure a second node is able to register itself
1 parent b09ab9f commit a4c3e3b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

java/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,14 @@ private void register(NodeStatus status) {
252252
public LocalDistributor add(Node node) {
253253
Require.nonNull("Node", node);
254254

255-
nodes.put(node.getId(), node);
256-
model.add(node.getStatus());
255+
// An exception occurs if Node heartbeat has started but the server is not ready.
256+
// Unhandled exception blocks the event-bus thread from processing any event henceforth.
257+
try {
258+
model.add(node.getStatus());
259+
nodes.put(node.getId(), node);
260+
} catch (Exception e){
261+
return this;
262+
}
257263

258264
// Extract the health check
259265
Runnable runnableHealthCheck = asRunnableHealthCheck(node);

0 commit comments

Comments
 (0)