Skip to content

Commit a1b59af

Browse files
authored
Documenting session timeout (#1378)
1 parent 50d63f5 commit a1b59af

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,18 @@ can do that through the `SE_NODE_GRID_URL` environment variable.
395395
Grid has a default session timeout of 300 seconds, where the session can be on a stale state until it is killed. You can use
396396
`SE_NODE_SESSION_TIMEOUT` to overwrite that value in seconds.
397397

398+
399+
### Session request timeout
400+
401+
A new session request is placed in the Session Queue before it is processed, and the request sits in the queue until a matching
402+
slot is found across the registered Nodes. However, the new session request might timeout if no slot was found. By default, a
403+
request will stay in the queue up to 300 seconds before it a timeout is reached. In addition, an attempt to process the request
404+
is done every 5 seconds (by default).
405+
406+
It is possible to override those values through environment variables in the Hub and the SessionQueue (`SE_SESSION_REQUEST_TIMEOUT`
407+
and `SE_SESSION_RETRY_INTERVAL`). For example, a timeout of 500 seconds would be `SE_SESSION_REQUEST_TIMEOUT=500` and a retry
408+
interval of 2 seconds would be `SE_SESSION_RETRY_INTERVAL=2`.
409+
398410
### Increasing session concurrency per container
399411

400412
By default, only one session is configured to run per container through the `SE_NODE_MAX_SESSIONS` environment variable. It is

SessionQueue/Dockerfile.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ USER 1200
44
# Selenium SessionQueue Configuration
55
#========================
66

7+
# In seconds, maps to "--session-request-timeout"
8+
ENV SE_SESSION_REQUEST_TIMEOUT 300
9+
# In seconds, maps to "--session-retry-interval"
10+
ENV SE_SESSION_RETRY_INTERVAL 5
11+
712
EXPOSE 5559
813

914
COPY start-selenium-grid-session-queue.sh \

SessionQueue/start-selenium-grid-session-queue.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ fi
3737
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server.jar sessionqueue \
3838
--publish-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_PUBLISH_PORT} \
3939
--subscribe-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_SUBSCRIBE_PORT} \
40+
--session-request-timeout ${SE_SESSION_REQUEST_TIMEOUT} \
41+
--session-retry-interval ${SE_SESSION_RETRY_INTERVAL} \
4042
${HOST_CONFIG} \
4143
${PORT_CONFIG} \
4244
${SE_OPTS}

0 commit comments

Comments
 (0)