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

update(chart): Node preStop and startupProbe in autoscaling Deployment #2139

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

VietND96
Copy link
Member

@VietND96 VietND96 commented Feb 19, 2024

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

Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

update(chart): Node preStop and startupProbe in autoscaling Deployment

Motivation and Context

  1. Node startup probe.
    Currently, the startup probe for Node is enabled by default with the method checking httpGet to Node endpoint /status. However, when the container is up, the Node port is reachable in a short time, but meanwhile, Node could still be in progress to send the registration event to Hub/Router. By using a script is inserted into the container (/opt/selenium/nodeProbe.sh) via ConfigMap for the startup probe with the method exec.command to cross-check Node is registered successfully by checking nodeId is present in Hub/Router (via SE_NODE_GRID_URL) before marking startup is successfully, otherwise Node will be restarted or CrashLoopBack if restarted many time and could not register.

  2. Node preStop hook
    Currently, the Node preStop hook is calling the Node endpoint to drain itself. However in autoscaling as Deployment, a possible race condition is something like Node drain and Distributor assign session at the same second (mentioned in [🐛 Bug]: Session is killed and removed from Session Map in the same second that it receives another request #2129 (comment)). Node preStop now will send a drain request to the Distributor (or Hub) first, and immediately the Node drains itself request to ensure the drain request comes to the Distributor and Node simultaneously.

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.

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.

1 participant