Skip to content

Commit dbdfc1f

Browse files
authored
Docker: Add Node env var SE_NODE_CONNECTION_LIMIT_PER_SESSION and README (#2855)
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 1989f7b commit dbdfc1f

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

ENV_VARIABLES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,6 @@
144144
| SE_NODE_REGISTER_SHUTDOWN_ON_FAILURE | true | If this flag is enabled, the Node will shut down after the register period is completed. This is useful for container environments to restart and register again. If restarted multiple times, the Node container status will be CrashLoopBackOff | --register-shutdown-on-failure |
145145
| SE_NODE_RELAY_BROWSER_VERSION | | | |
146146
| SE_NODE_RELAY_ONLY | true | | |
147-
| SE_EXTRA_LIBS | | Extra jars to add to the classpath | --ext |
147+
| SE_EXTRA_LIBS | | Extra jars to add to the classpath in server component bootstrap | --ext |
148+
| SE_NODE_CONNECTION_LIMIT_PER_SESSION | 10 | | |
149+
| SE_SUPERVISORD_UNIX_SERVER_PASSWORD | secret | | |

NodeBase/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ ENV LANG_WHICH=${LANG_WHICH} \
4949
SE_NODE_REGISTER_PERIOD="120" \
5050
SE_NODE_REGISTER_CYCLE="10" \
5151
SE_NODE_REGISTER_SHUTDOWN_ON_FAILURE="true" \
52+
SE_NODE_CONNECTION_LIMIT_PER_SESSION="10" \
5253
SE_OTEL_SERVICE_NAME="selenium-node" \
5354
SE_NODE_RELAY_ONLY="true" \
5455
# Setting Selenium Manager to work offline

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,5 +1901,14 @@ mkdir /tmp/videos
19011901
chown 1200:1201 /tmp/videos
19021902
```
19031903
1904+
### Websocket connections per session get exhausted
1905+
1906+
> org.openqa.selenium.remote.http.ConnectionFailedException: JdkWebSocket initial request execution error`
1907+
1908+
This was reported in [#2850](https://github.com/SeleniumHQ/docker-selenium/issues/2850).
1909+
Actually, from Grid version v4.26.0+, in Node CLI option `--connection-limit-per-session` (`SE_NODE_CONNECTION_LIMIT_PER_SESSION` environment variable) is set to `10` by default. Let X be the maximum number of websocket connections per session.This will ensure one session is not able to exhaust the connection limit of the host. Websocket connection might come from enable CDP, BiDi.
1910+
1911+
Your test scenario or test framework implementation might be creating more than `X` connections per session, which will lead to the error above. You can optimize your implementation to use less connections per session, or you can increase the limit by setting the environment variable `SE_NODE_CONNECTION_LIMIT_PER_SESSION` to a value higher than `10` to allow more connections per session.
1912+
19041913
## Stargazers over time
19051914
[![Stargazers over time](https://starchart.cc/SeleniumHQ/docker-selenium.svg?variant=adaptive)](https://starchart.cc/SeleniumHQ/docker-selenium)

scripts/generate_list_env_vars/description.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,12 @@
440440
- name: SE_NODE_RELAY_ONLY
441441
description: ''
442442
cli: ''
443+
- name: SE_EXTRA_LIBS
444+
description: Extra jars to add to the classpath in server component bootstrap
445+
cli: --ext
446+
- name: SE_NODE_CONNECTION_LIMIT_PER_SESSION
447+
description: ''
448+
cli: ''
449+
- name: SE_SUPERVISORD_UNIX_SERVER_PASSWORD
450+
description: ''
451+
cli: ''

scripts/generate_list_env_vars/value.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
default: '4443'
3737
- name: SE_EXTERNAL_URL
3838
default: ''
39+
- name: SE_EXTRA_LIBS
40+
default: ''
3941
- name: SE_FRAME_RATE
4042
default: '15'
4143
- name: SE_GRID_URL
@@ -78,6 +80,8 @@
7880
default: ''
7981
- name: SE_NODE_BROWSER_VERSION
8082
default: stable
83+
- name: SE_NODE_CONNECTION_LIMIT_PER_SESSION
84+
default: '200'
8185
- name: SE_NODE_CONTAINER_NAME
8286
default: ''
8387
- name: SE_NODE_DOCKER_CONFIG_FILENAME
@@ -240,6 +244,8 @@
240244
default: /tmp/supervisord.pid
241245
- name: SE_SUPERVISORD_START_RETRIES
242246
default: '5'
247+
- name: SE_SUPERVISORD_UNIX_SERVER_PASSWORD
248+
default: secret
243249
- name: SE_UPLOAD_COMMAND
244250
default: ''
245251
- name: SE_UPLOAD_DESTINATION_PREFIX

0 commit comments

Comments
 (0)