[🐛 Bug]: Duplicate video recording processes in dynamic Grid with standalone video container

Đang mở
#3,153 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker
Lĩnh vực
devops, infrastructure

Hướng nghiên cứu

Bắt đầu bằng cách so sánh hành vi trước và sau pull request 3131, sau đó kiểm tra video_recorder.py, video.sh và config.toml được cung cấp. Tái hiện sự cố bằng các systemd quadlet và image browser/recorder đã nêu; hoàn thành có nghĩa là chỉ recorder độc lập chạy ffmpeg và container browser không tạo tệp video thứ hai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs-triaging
What happened?

As of Grid v4.44.0, in a dynamic grid deployment using the standalone video container, both the browser and the video container run ffmpeg, instead of just the video container. This doubles the load and leads to OOM-killer being triggered on our Grid server.

It looks like https://github.com/SeleniumHQ/docker-selenium/pull/3131 caused this. If I pin the browser container to the older version in config.toml, then only the recorder container tries to create the video file, as expected.

config.toml:

[docker]
configs = [
  "selenium/standalone-firefox:4.44.0-20260505", '{"browserName": "firefox", "platformName": "linux"}',
  "selenium/standalone-chrome:4.44.0-20260505", '{"browserName": "chrome", "platformName": "linux"}',
  "selenium/standalone-edge:4.44.0-20260505", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
]
host-config-keys = ["Dns", "DnsOptions", "DnsSearch", "ExtraHosts", "Binds"]
url = "http://127.0.0.1:2375"
video-image = "selenium/video:ffmpeg-8.1-20260505"

Quadlets:

# cat /etc/containers/systemd/selenium-hub.container 
[Container]
ContainerName=selenium-hub
Image={PROXY_REGISTRY}/selenium/hub:4.44.0-20260505
LogDriver=journald
Network=selenium-grid.network
PublishPort=4442:4442
PublishPort=4443:4443
PublishPort=4444:4444
PublishPort=[::]:4442:4442
PublishPort=[::]:4443:4443
PublishPort=[::]:4444:4444

[Unit]
StartLimitIntervalSec=30
StartLimitBurst=2

[Service]
Restart=always

[Install]
WantedBy=default.target

# cat /etc/containers/systemd/selenium-node.container 
[Container]
ContainerName=selenium-node
Environment=DOCKER_SOCK=/var/run/podman/podman.sock
Environment=SE_EVENT_BUS_HOST=selenium-hub
Environment=SE_VIDEO_RECORD_STANDALONE=True
Image={PROXY_REGISTRY}/selenium/node-docker:4.44.0-20260505
LogDriver=journald
Network=selenium-grid.network
Volume=/root/config.toml:/opt/selenium/docker.toml
Volume=/var/run/podman/podman.sock:/var/run/docker.sock
Volume=/var/www/html/videos:/opt/selenium/assets
PodmanArgs=--privileged

[Unit]
StartLimitIntervalSec=30
StartLimitBurst=2
After=selenium-hub.service

[Service]
Restart=always

[Install]
WantedBy=default.target

# cat /etc/containers/systemd/selenium-grid.network 
[Network]
NetworkName=selenium-grid
IPv6=true
Command used to start Selenium Grid with Docker (or Kubernetes)
systemctl start selenium-hub selenium-node
# See issue description for configuration files
Relevant log output
Example ps output showing both types of containers creating video files during a session:
# browser

root       58606       1  0 70729  2340   4 16:01 ?        00:00:00 /usr/bin/conmon [...] -n browser-chrome-1779912103789-09589650 [...]
1200       58618   58606  0  1868  3928  36 16:01 ?        00:00:00 bash /opt/bin/entry_point.sh
1200       58633   58618  0  9775 27744  25 16:01 ?        00:00:00 /home/seluser/venv/bin/python3 /home/seluser/venv/bin/supervisord --configuration /etc/supervisord.conf
1200       58643   58633  0 86582 35608  44 16:01 ?        00:00:00 python3 /opt/bin/video_recorder.py
1200       59917   58643 39 243620 110644 67 16:01 ?       00:00:23 ffmpeg -hide_banner -loglevel warning -threads 1 -thread_queue_size 512 -probesize 32M -analyzeduration 0 -y -f x11grab -video_size 1920x1080 -r 15 -i localhost:99.0 -codec:v libx264 -preset ultrafast -tune zerolatency -crf 28 -maxrate 1000k -bufsize 2000k -pix_fmt yuv420p -movflags frag_keyframe+empty_moov+default_base_moof /videos/9dcf6077b210526ac880b795741f6c93.mp4

# recorder

root       60454       1  0 70729  2340  71 16:01 ?        00:00:00 /usr/bin/conmon [...] -n recorder-chrome-1779912107824-21447003 [...]
1200       60465   60454  0  1081  3524  57 16:01 ?        00:00:00 bash /opt/bin/entry_point.sh
1200       60484   60465  0  8857 27344  54 16:01 ?        00:00:00 /home/seluser/venv/bin/python3 /home/seluser/venv/bin/supervisord --configuration /etc/supervisord.conf
1200       60490   60484  0  4207 11256  12 16:01 ?        00:00:00 python3 /opt/bin/video_recorder.py
1200       60492   60490  0  1210  3788  70 16:01 ?        00:00:00 bash /opt/bin/video.sh
1200       60503   60492 50 243425 109504 61 16:01 ?       00:00:28 ffmpeg -hide_banner -loglevel warning -threads 1 -thread_queue_size 512 -probesize 32M -analyzeduration 0 -y -f x11grab -video_size 1920x1080 -r 15 -i 10.89.0.34:99.0 -codec:v libx264 -preset ultrafast -tune zerolatency -crf 28 -maxrate 1000k -bufsize 2000k -pix_fmt yuv420p -movflags frag_keyframe+empty_moov+default_base_moof /videos/video.mp4
Operating System

RHEL 8

Docker Selenium version (image tag)

4.44.0-20260505

Selenium Grid chart version (chart version)

No response

Ngôn ngữ chính
Go
Star
8.7k
Fork
2.5k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
37

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SeleniumHQ/docker-selenium

Tất cả issue của SeleniumHQ/docker-selenium

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.