[grid] stop the health check of a restarted node #15011
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Description
This PR will stop the old health check of a restarted node and remove the old node from the model.
The
NodeRestartedEvent
will now contain the node status of the old node, this will allow to cleanup related resources.The status of a newly added node is DOWN in any case, so sending the node status of the new node with the event was kind of useless anyway. This is also the reason for removing the old
LocalDistributer.handleNodeRestarted
code.Motivation and Context
This will speed up the cleanup and should fix a leak, as the node is removed from the model before raising the event.
But removing it from the model will stop the dead node detection, so the old health check should never be stopped.
Types of changes
Checklist
PR Type
Bug fix, Enhancement
Description
Updated
NodeRestartedEvent
to use previous node status for cleanup.Improved logging with detailed node information (ID and URI).
Removed redundant
handleNodeRestarted
method inLocalDistributor
.Simplified node removal logic across multiple session map implementations.
Changes walkthrough 📝
GridModel.java
Refactor node restart and removal logic
java/src/org/openqa/selenium/grid/distributor/GridModel.java
NodeRestartedEvent
to use previous node status.LocalDistributor.java
Simplify node restart handling in LocalDistributor
java/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java
handleNodeRestarted
method.NodeRestartedEvent
.JdbcBackedSessionMap.java
Update session cleanup for restarted nodes in JDBC
java/src/org/openqa/selenium/grid/sessionmap/jdbc/JdbcBackedSessionMap.java
NodeRestartedEvent
listener to use previous node status.LocalSessionMap.java
Enhance session cleanup for restarted nodes locally
java/src/org/openqa/selenium/grid/sessionmap/local/LocalSessionMap.java
NodeRestartedEvent
listener to use previous node status.RedisBackedSessionMap.java
Improve session cleanup for restarted nodes in Redis
java/src/org/openqa/selenium/grid/sessionmap/redis/RedisBackedSessionMap.java
NodeRestartedEvent
listener to use previous node status.