Skip to content

Commit 48d5121

Browse files
committed
Fix recording shutdown for node docker
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
1 parent 18dd0c2 commit 48d5121

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

StandaloneDocker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ ENV SE_SESSION_REQUEST_TIMEOUT="300" \
2121
# Boolean value, maps "--relax-checks"
2222
SE_RELAX_CHECKS="true" \
2323
SE_OTEL_SERVICE_NAME="selenium-standalone-docker" \
24-
SE_NODE_ENABLE_MANAGED_DOWNLOADS="true"
24+
SE_NODE_ENABLE_MANAGED_DOWNLOADS="true" \
25+
SE_BIND_BUS="true" \
26+
SE_EVENT_BUS_IMPLEMENTATION=""

StandaloneDocker/start-selenium-grid-docker.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ if [ ! -z "${SE_EVENT_BUS_HEARTBEAT_PERIOD}" ]; then
108108
append_se_opts "--eventbus-heartbeat-period" "${SE_EVENT_BUS_HEARTBEAT_PERIOD}"
109109
fi
110110

111+
if [ ! -z "${SE_EVENT_BUS_IMPLEMENTATION}" ]; then
112+
append_se_opts "--events-implementation" "${SE_EVENT_BUS_IMPLEMENTATION}"
113+
fi
114+
115+
if [ "${SE_BIND_BUS}" = "true" ]; then
116+
append_se_opts "--bind-bus" "${SE_BIND_BUS}"
117+
append_se_opts "--publish-events" "tcp://*:${SE_EVENT_BUS_PUBLISH_PORT}"
118+
append_se_opts "--subscribe-events" "tcp://*:${SE_EVENT_BUS_SUBSCRIBE_PORT}"
119+
if [ -z "${SE_EVENT_BUS_IMPLEMENTATION}" ]; then
120+
append_se_opts "--events-implementation" "org.openqa.selenium.events.zeromq.ZeroMqEventBus"
121+
fi
122+
fi
123+
111124
if [ "${SE_ENABLE_TLS}" = "true" ]; then
112125
# Configure truststore for the server
113126
if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then

Video/video_recorder.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def main():
5151

5252
def _mark_external_shutdown(signum, frame):
5353
_external_shutdown[0] = True
54+
# This handler is only reachable before asyncio.run() installs its
55+
# own handlers via loop.add_signal_handler(). Setting the flag and
56+
# returning would swallow the signal — nothing would act on it and
57+
# the process would hang inside asyncio.run() indefinitely.
58+
# Exit immediately so supervisord sees a clean stop.
59+
sys.exit(0)
5460

5561
signal.signal(signal.SIGTERM, _mark_external_shutdown)
5662
signal.signal(signal.SIGINT, _mark_external_shutdown)

tests/docker-compose-v3-test-standalone-docker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ services:
1414
- SE_NODE_ENABLE_MANAGED_DOWNLOADS=${SELENIUM_ENABLE_MANAGED_DOWNLOADS}
1515
- SE_NODE_GRID_URL=${GRID_URL}
1616
- SE_OPTS=--log-level ${LOG_LEVEL} --enable-managed-downloads ${SELENIUM_ENABLE_MANAGED_DOWNLOADS}
17+
- SE_EVENT_BUS_HOST=selenium-hub
1718
- SE_VIDEO_EVENT_DRIVEN=${VIDEO_EVENT_DRIVEN}
1819
- SE_VIDEO_RECORD_STANDALONE=${RECORD_STANDALONE}
1920
- SE_VIDEO_FILE_NAME=${VIDEO_FILE_NAME}

0 commit comments

Comments
 (0)