-
-
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] delay the newsessionqueue response #14764
base: trunk
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.