Skip to content
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

Move node selection logic in a package #8513

Merged
merged 25 commits into from
Aug 18, 2020

Conversation

raju249
Copy link
Member

@raju249 raju249 commented Jul 13, 2020

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Description

This PR separates the tightly coupled logic of nodeSelection to run a session, into a separate package and can be independently modified going forward. It doesn't and should not change any functionality from previoud build and should not show any differences for the user to run a session.

Motivation and Context

  1. There is work going on adding support for RedisDistributor for which this same nodeSelection Package would be used/modified to make it work with redis backed distributor.
  2. Hence as a first step in MVP and not have too may changes in RedisDistributor PR, this PR will make that change and I would iterate from there after it is merged.
  3. The GridModel class stores the nodes and listens to addition and removal of Nodes. The NodeSelector class will help us select the node from the pool of nodes. Now, this pool of the nodes can be an in-memory hash map for a local distributor, it can also be a redis backed store for RedisBasedDistributor or a database backed store for JdbcBackedDistributor

The changes to make the datastore configurable inside the NodeSelector class will be done in #8403

Types of changes

  • [-] Bug fix (non-breaking change which fixes an issue)
  • [-] New feature (non-breaking change which adds functionality)
  • [-] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • [-] My change requires a change to the documentation.
  • [-] I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@raju249 raju249 changed the title Node selection algo WIP: Node selection algo Jul 13, 2020
@raju249 raju249 changed the title WIP: Node selection algo WIP: Move node selection logic in a package Jul 13, 2020
@raju249 raju249 changed the title WIP: Move node selection logic in a package Move node selection logic in a package Jul 14, 2020
Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raju249
Could you please add some context to the PR? The PR template is being completely ignored.
How can this be tested? Why are these changes made?

@raju249
Copy link
Member Author

raju249 commented Jul 16, 2020

Hey @diemol I have updated the PR description. Please take a look. Thanks 🙇

@AutomatedTester AutomatedTester linked an issue Jul 21, 2020 that may be closed by this pull request
Copy link
Member

@shs96c shs96c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that what we want to do is to ensure that the model is immutable, and a snapshot of the understood state of the system at the time it's created. It's also just a model, so there's no need to have things like Host.runHealthCheck

@AutomatedTester
Copy link
Member

I believe all comments have been addressed and will merge on Tuesday morning

@shs96c @diemol

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raju249 I made the changes we spoke about. Please have a look, and if you are ok with them, we can merge this. Thanks!

@raju249
Copy link
Member Author

raju249 commented Aug 18, 2020

Thanks much @diemol 🙇

Changes LGTM. 👍

We can land this.

@diemol diemol merged commit c86baa6 into SeleniumHQ:trunk Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Grid] Distributor should store state
4 participants