-
-
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] limit the number of websocket connections per session #14410
Conversation
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
CI Failure Feedback 🧐(Checks updated until commit 0b5e1c8)
✨ 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 |
Thank you, @joerg1985 ! |
User description
Description
This change will add a limit of 10 websocket connections per session.
The
NodeOptions
/NodeFlags
do allow to overwrite this default value.Motivation and Context
Usually a client should only open a small number of websocket connections per session.
But there is no limit so a single session can block a lot of resources when connecting again and again.
@diemol this is the PR related to my email and 5bac479 does at least ensure as soon as the client closes the websocket connection, the connection between the hub and the node / the node and the driver is released.
Types of changes
Checklist
PR Type
enhancement, tests
Description
Changes walkthrough 📝
7 files
Node.java
Add websocket connection limit management in Node
java/src/org/openqa/selenium/grid/node/Node.java
session.
tryAcquireConnection
method to manage connection limits.ProxyNodeWebsockets.java
Implement websocket connection limit check in ProxyNodeWebsockets
java/src/org/openqa/selenium/grid/node/ProxyNodeWebsockets.java
connections.
TryAcquireConnection.java
Create TryAcquireConnection class for connection limit handling
java/src/org/openqa/selenium/grid/node/TryAcquireConnection.java
TryAcquireConnection
class to handle connection limitrequests.
OneShotNode.java
Integrate connection limit logic in OneShotNode
java/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java
LocalNode.java
Implement connection limit logic in LocalNode
java/src/org/openqa/selenium/grid/node/local/LocalNode.java
SessionSlot.java
Add and manage connection counter in SessionSlot
java/src/org/openqa/selenium/grid/node/local/SessionSlot.java
RemoteNode.java
Implement remote connection limit check in RemoteNode
java/src/org/openqa/selenium/grid/node/remote/RemoteNode.java
3 files
NodeFlags.java
Add connection limit per session parameter in NodeFlags
java/src/org/openqa/selenium/grid/node/config/NodeFlags.java
NodeOptions.java
Define and retrieve default connection limit in NodeOptions
java/src/org/openqa/selenium/grid/node/config/NodeOptions.java
LocalNodeFactory.java
Configure LocalNode with connection limit settings
java/src/org/openqa/selenium/grid/node/local/LocalNodeFactory.java
1 files
AddingNodesTest.java
Add test stub for connection limit logic in AddingNodesTest
java/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java