-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[grid] Exclude status DRAINING when distributor getting available nodes #14282
Conversation
Signed-off-by: Viet Nguyen Duc <[email protected]>
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
@diemol, can you review this? |
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.
@VietND96 Thank you!
Waiting for this release as well as I encountered issues when running parallel tests using Kubernetes with auto KEDA autoscaling. Hope this will fix my issue. Thanks |
…es (SeleniumHQ#14282) Signed-off-by: Viet Nguyen Duc <[email protected]>
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
[grid] Exclude status DRAINING when distributor getting available nodes
Motivation and Context
Fix for an intermittent issue when Selenium Grid autoscaling in Kubernetes.
In autoscaling, a Node can be a one-shot node (run as Job, pod will be terminated after 1 session) or a long-run node (run as Deployment, pod will be scaled down after a cool-down period). The common thing, when the pod is terminated, node will send a drain request, and stay with status
DRAINING
until the current session is completed or the container stops completely.A race condition in multi-threading allows the function `getAvailableNodes () ' to pick a free slot with status DRAINING and assign new session since only status DOWN is excluded.
The error could be seen as below
Linking tickets that could be similar
SeleniumHQ/docker-selenium#2129
SeleniumHQ/docker-selenium#2155
Types of changes
Checklist
PR Type
Bug fix
Description
DRAINING
status when the distributor fetches available nodes.DRAINING
status could be incorrectly assigned a new session.Changes walkthrough 📝
LocalDistributor.java
Exclude nodes with DRAINING status from available nodes
java/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java
DRAINING
status when fetchingavailable nodes.
DOWN
andDRAINING
areconsidered available.