-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[grid] Restructuring classes have stateful data and improve Node health checks in LocalDistributor #16151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to f604877
Previous suggestions✅ Suggestions up to commit 7ef687a
✅ Suggestions up to commit c7aeee4
|
Signed-off-by: Viet Nguyen Duc <[email protected]>
c7aeee4
to
c7e2984
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it makes sense to me. Thank you for this.
Please have a look at the AI reviewer suggestions and see if they make sense or not.
Signed-off-by: Viet Nguyen Duc <[email protected]>
@diemol on AI review points that I fixed
On point "Duplicated health-check scheduling" - I am thinking another improvement on other PR.
|
Signed-off-by: Viet Nguyen Duc <[email protected]>
Signed-off-by: Viet Nguyen Duc <[email protected]>
f604877
to
bf1ab2c
Compare
User description
🔗 Related Issues
Part of SeleniumHQ/docker-selenium#1849
Restructuring classes to get ready for the next step in the implementation of the external datastore support
💥 What does this PR do?
No new functions added or removed, just restructuring.
Separation of Complex Logic
LocalNodeRegistry
LocalDistributor
GridModel
is updated toLocalGridModel
Clean Separation of Concerns
By restructuring these classes to bring all stateful functions under
distributor/local
, try to create a clear distinction between:GridModel
,NodeRegistry
)LocalGridModel
,LocalNodeRegistry
,LocalDistributor
).Get ready for external data store support
distributor/redis
ordistributor/jdbc
) without modifying core componentsGet ready for high availability support
Once the external datastore can be implemented, it would enable multiple distributor replicas to run simultaneously:
Architectural Improvements
Testability: Easier mocking of components for testing
Scalability: Path to horizontal scaling of distributor component
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Restructure LocalDistributor to separate node management from session distribution
Extract node registry logic into LocalNodeRegistry interface
Convert GridModel to abstract class with LocalGridModel implementation
Prepare architecture for external datastore support
Diagram Walkthrough
File Walkthrough
GridModel.java
Convert GridModel to abstract interface
java/src/org/openqa/selenium/grid/distributor/GridModel.java
NodeRegistry.java
Add NodeRegistry interface definition
java/src/org/openqa/selenium/grid/distributor/NodeRegistry.java
LocalDistributor.java
Delegate node management to NodeRegistry
java/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java
LocalGridModel.java
Implement LocalGridModel with original logic
java/src/org/openqa/selenium/grid/distributor/local/LocalGridModel.java
LocalNodeRegistry.java
Implement LocalNodeRegistry with node management
java/src/org/openqa/selenium/grid/distributor/local/LocalNodeRegistry.java