Skip to content

Commit 941b8a9

Browse files
committed
[grid] Logging Node url instead of id, better readability
[skip ci]
1 parent 58e521a commit 941b8a9

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

java/src/org/openqa/selenium/grid/distributor/GridModel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void add(NodeStatus node) {
9191
while (iterator.hasNext()) {
9292
NodeStatus next = iterator.next();
9393

94-
// If the ID the same and the URI is the same, use the same
94+
// If the ID and the URI are the same, use the same
9595
// availability as the version we have now: we're just refreshing
9696
// an existing node.
9797
if (next.getNodeId().equals(node.getNodeId()) && next.getExternalUri().equals(node.getExternalUri())) {
@@ -106,7 +106,7 @@ public void add(NodeStatus node) {
106106
return;
107107
}
108108

109-
// If the URI is the same but NodeId is different then the Node has restarted
109+
// If the URI is the same but NodeId is different, then the Node has restarted
110110
if(!next.getNodeId().equals(node.getNodeId()) &&
111111
next.getExternalUri().equals(node.getExternalUri())) {
112112
LOG.info(String.format("Re-adding node with id %s and URI %s.", node.getNodeId(), node.getExternalUri()));
@@ -220,11 +220,11 @@ public void purgeDeadNodes() {
220220
Instant deadTime = lastTouched.plus(node.getHeartbeatPeriod().multipliedBy(PURGE_TIMEOUT_MULTIPLIER));
221221

222222
if (node.getAvailability() == UP && lostTime.isBefore(now)) {
223-
LOG.info(String.format("Switching node %s from UP to DOWN", node.getNodeId()));
223+
LOG.info(String.format("Switching Node %s from UP to DOWN", node.getExternalUri()));
224224
replacements.put(node, rewrite(node, DOWN));
225225
}
226226
if (node.getAvailability() == DOWN && deadTime.isBefore(now)) {
227-
LOG.info(String.format("Removing node %s that is DOWN for too long", node.getNodeId()));
227+
LOG.info(String.format("Removing Node %s, DOWN for too long", node.getExternalUri()));
228228
toRemove.add(node);
229229
}
230230
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public LocalDistributor add(Node node) {
317317
.withDelay(Duration.ofSeconds(15))
318318
.abortIf(result -> true);
319319

320-
LOG.log(getDebugLogLevel(), "Running initial health check for Node " + node.getId());
320+
LOG.log(getDebugLogLevel(), "Running initial health check for Node " + node.getUri());
321321
Executors.newSingleThreadExecutor().submit(
322322
() -> Failsafe.with(initialHealthCheckPolicy).run(runnableHealthCheck::run));
323323

@@ -347,7 +347,7 @@ private Runnable asRunnableHealthCheck(Node node) {
347347
return () -> {
348348
boolean checkFailed = false;
349349
Exception failedCheckException = null;
350-
LOG.log(getDebugLogLevel(), "Running health check for " + node.getId());
350+
LOG.log(getDebugLogLevel(), "Running health check for " + node.getUri());
351351

352352
HealthCheck.Result result;
353353
try {
@@ -366,7 +366,7 @@ private Runnable asRunnableHealthCheck(Node node) {
366366
getDebugLogLevel(),
367367
String.format(
368368
"Health check result for %s was %s",
369-
node.getId(),
369+
node.getUri(),
370370
result.getAvailability()));
371371
model.setAvailability(id, result.getAvailability());
372372
model.updateHealthCheckCount(id, result.getAvailability());

java/src/org/openqa/selenium/grid/node/httpd/NodeServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public NettyServer start() {
198198
.withDelay(nodeOptions.getRegisterCycle())
199199
.handleResultIf(result -> true);
200200

201-
LOG.info("Starting registration process for node id " + node.getId());
201+
LOG.info("Starting registration process for Node " + node.getUri());
202202
Executors.newSingleThreadExecutor().submit(() -> {
203203
Failsafe.with(registrationPolicy).run(
204204
() -> {

0 commit comments

Comments
 (0)