File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
java/server/src/org/openqa/selenium/grid/distributor Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -190,15 +190,16 @@ public void purgeDeadNodes() {
190
190
Set <NodeStatus > toRemove = new HashSet <>();
191
191
192
192
for (NodeStatus node : nodes ) {
193
+ Instant now = Instant .now ();
193
194
Instant lastTouched = nodePurgeTimes .getOrDefault (node .getNodeId (), Instant .now ());
194
195
Instant lostTime = lastTouched .plus (node .getHeartbeatPeriod ().multipliedBy (PURGE_TIMEOUT_MULTIPLIER / 2 ));
195
196
Instant deadTime = lastTouched .plus (node .getHeartbeatPeriod ().multipliedBy (PURGE_TIMEOUT_MULTIPLIER ));
196
197
197
- if (node .getAvailability () == UP && lastTouched .isBefore (lostTime )) {
198
+ if (node .getAvailability () == UP && lostTime .isBefore (now )) {
198
199
LOG .info (String .format ("Switching node %s from UP to DOWN" , node .getNodeId ()));
199
200
replacements .put (node , rewrite (node , DOWN ));
200
201
}
201
- if (node .getAvailability () == DOWN && lastTouched .isBefore (deadTime )) {
202
+ if (node .getAvailability () == DOWN && deadTime .isBefore (now )) {
202
203
LOG .info (String .format ("Removing node %s that is DOWN for too long" , node .getNodeId ()));
203
204
toRemove .add (node );
204
205
}
You can’t perform that action at this time.
0 commit comments