-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] delay the newsessionqueue response #14764
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
This makes sense. However, do you want to expose the delay time as config? @joerg1985 |
CI Failure Feedback 🧐(Checks updated until commit 0ff9e0a)
✨ CI feedback usage guide:The CI feedback tool (
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:
where Configuration options
See more information about the |
9142af9
to
06e064b
Compare
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
* [grid] delay the newsessionqueue response * Update variable naming with prefix `DEFAULT_` Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com> --------- Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com> Co-authored-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
User description
Description
This PR will delay the newsessionqueue response in case there is no data, to reduce the http requests while polling for new session requests. The maximum delay before retuning no data to the client is 8000ms. To ensure the polling does not prevent the writers to enter the lock, entering the lock is reworked too.
Motivation and Context
A single node in a fully distributed grid does perform ~50 http requests per second in my local grid.
Adding more nodes will increase the total http requests per second and does create not needed traffic.
Types of changes
Checklist
PR Type
enhancement
Description
getNextAvailable
method to reduce unnecessary HTTP requests by delaying the response for up to 8000ms if the queue is empty.tryLock
to improve concurrency handling and reduce potential deadlocks.Changes walkthrough 📝
LocalNewSessionQueue.java
Implement delay and non-blocking locks in session queue
java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java
tryLock
.empty.