-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[grid] limit the number of websocket connections per session #14410
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
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/NodeFlagsdo 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 Nodejava/src/org/openqa/selenium/grid/node/Node.java
session.
tryAcquireConnectionmethod to manage connection limits.ProxyNodeWebsockets.java
Implement websocket connection limit check in ProxyNodeWebsocketsjava/src/org/openqa/selenium/grid/node/ProxyNodeWebsockets.java
connections.
TryAcquireConnection.java
Create TryAcquireConnection class for connection limit handlingjava/src/org/openqa/selenium/grid/node/TryAcquireConnection.java
TryAcquireConnectionclass to handle connection limitrequests.
OneShotNode.java
Integrate connection limit logic in OneShotNodejava/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java
LocalNode.java
Implement connection limit logic in LocalNodejava/src/org/openqa/selenium/grid/node/local/LocalNode.java
SessionSlot.java
Add and manage connection counter in SessionSlotjava/src/org/openqa/selenium/grid/node/local/SessionSlot.java
RemoteNode.java
Implement remote connection limit check in RemoteNodejava/src/org/openqa/selenium/grid/node/remote/RemoteNode.java
3 files
NodeFlags.java
Add connection limit per session parameter in NodeFlagsjava/src/org/openqa/selenium/grid/node/config/NodeFlags.java
NodeOptions.java
Define and retrieve default connection limit in NodeOptionsjava/src/org/openqa/selenium/grid/node/config/NodeOptions.java
LocalNodeFactory.java
Configure LocalNode with connection limit settingsjava/src/org/openqa/selenium/grid/node/local/LocalNodeFactory.java
1 files
AddingNodesTest.java
Add test stub for connection limit logic in AddingNodesTestjava/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java