[🐛 Bug]: Video recorder can be so slow to start that it misses the session entirely

未关闭
#3,279 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker, go, kubernetes

调研方向

Start by tracing how docker-selenium’s video service handles session-created and session-closed events, and compare those timestamps with the Grid node logs in the report. The payload does not name source files or tests, so locate the event handling entry point and any related tests first. Done means recording starts in time to capture the session and stops correctly when it closes.

由索引模型根据 Issue 内容生成。

描述

needs-triaging
What happened?

I use the in node video recording, producing a separate recording for each session. Sometimes I see that the video recording doesn't begin until after the session has finished. Look at the session "9fd711426b480dcc532d4a8f3daf29af" in the logs below. The driver session beings at 17:01:16 and finishes by 17:01:24. Video recording doesn't start until 17:01:26 - 10 seconds after the driver session began and 2 seconds after it finished. So my questions are:

  1. Why start recording when the target session has already terminated.
  2. Why is video recording so slow to start? Is this a known issue? Should I be querying whether video recording has begun before I start actually performing the driver actions I want recorded?
Command used to start Selenium Grid with Docker (or Kubernetes)

I set these environment variables in my node containers:

SE_VIDEO_INTERNAL_UPLOAD=false
SE_VIDEO_FILE_NAME=auto
Relevant log output
17:01:16.054 INFO [LocalNode.newSession] - Session created by the Node. Id: 9fd711426b480dcc532d4a8f3daf29af, Caps: {acceptInsecureCerts=false, browserName=MicrosoftEdge, browserVersion=155.0.4283.45, fedcm:accounts=true, goog:processID=7823, ms:edgeOptions={debuggerAddress=localhost:46599}, msedge={msedgedriverVersion=155.0.4283.45 (50f24ef2aa5369a074b8888b7db82d9c0652d642), userDataDir=/home/seluser/selenium/profile}, networkConnectionEnabled=false, pageLoadStrategy=normal, platformName=linux, proxy=Proxy(), se:cdp=ws://localhost:4444/session/9fd711426b480dcc532d4a8f3daf29af/se/cdp, se:cdpVersion=155.0.4283.45, se:containerName=edge-node-4, se:deleteSessionOnUi=true, se:downloadsEnabled=true, se:gridWebSocketUrl=ws://localhost:3841/session/9fd711426b480dcc532d4a8f3daf29af, setWindowRect=true, strictFileInteractability=false, timeouts={implicit=0, pageLoad=300000, script=30000}, unhandledPromptBehavior=dismiss and notify, webSocketUrl=ws://localhost:4444/session/9fd711426b480dcc532d4a8f3daf29af/se/bidi, webauthn:extension:cmtgKey=true, webauthn:extension:credBlob=true, webauthn:extension:largeBlob=true, webauthn:extension:minPinLength=true, webauthn:extension:prf=true, webauthn:virtualAuthenticators=true}
17:01:16.078 INFO [ProxyNodeWebsockets.createWsEndPoint] - Establishing connection to ws://localhost:3841/session/9fd711426b480dcc532d4a8f3daf29af
17:01:24.084 INFO [LocalNode.stopTimedOutSession] - Session id 9fd711426b480dcc532d4a8f3daf29af is stopping on demand...
17:01:24.084 INFO [SessionSlot.stop] - Stopping session 9fd711426b480dcc532d4a8f3daf29af (reason: QUIT_COMMAND)
17:01:24.084 INFO [SessionSlot.stop] - Session stopped successfully: 9fd711426b480dcc532d4a8f3daf29af
17:01:24.118 INFO [LocalNode.newSession] - Not using file system: desiredCapabilities=Capabilities {browserName: MicrosoftEdge, ms:edgeOptions: {args: [--user-data-dir=/home/selus..., --profile-directory=Default]}, se:remoteUrl: http://localhost:4444/wd/hub/, webSocketUrl: true}
17:01:25.177 INFO [LocalNode.newSession] - Session created by the Node. Id: e014dfd6f5e08a9f5abee55fd8273ac3, Caps: {acceptInsecureCerts=false, browserName=MicrosoftEdge, browserVersion=155.0.4283.45, fedcm:accounts=true, goog:processID=8313, ms:edgeOptions={debuggerAddress=localhost:37057}, msedge={msedgedriverVersion=155.0.4283.45 (50f24ef2aa5369a074b8888b7db82d9c0652d642), userDataDir=/home/seluser/selenium/profile}, networkConnectionEnabled=false, pageLoadStrategy=normal, platformName=linux, proxy=Proxy(), se:cdp=ws://localhost:4444/session/e014dfd6f5e08a9f5abee55fd8273ac3/se/cdp, se:cdpVersion=155.0.4283.45, se:containerName=edge-node-4, se:deleteSessionOnUi=true, se:downloadsEnabled=true, se:gridWebSocketUrl=ws://localhost:19903/session/e014dfd6f5e08a9f5abee55fd8273ac3, setWindowRect=true, strictFileInteractability=false, timeouts={implicit=0, pageLoad=300000, script=30000}, unhandledPromptBehavior=dismiss and notify, webSocketUrl=ws://localhost:4444/session/e014dfd6f5e08a9f5abee55fd8273ac3/se/bidi, webauthn:extension:cmtgKey=true, webauthn:extension:credBlob=true, webauthn:extension:largeBlob=true, webauthn:extension:minPinLength=true, webauthn:extension:prf=true, webauthn:virtualAuthenticators=true}
17:01:25.212 INFO [ProxyNodeWebsockets.createWsEndPoint] - Establishing connection to ws://localhost:19903/session/e014dfd6f5e08a9f5abee55fd8273ac3
2026-10-20 17:01:26, [video.service] - Stopped recording: session=521ebd4a07896b620950ca41085f0c00, duration=483.3s
2026-10-20 17:01:26, [video.service] - Received event: session-created, nodeId=f1a8d5bf-f660-472d-b2f8-5a21c0f08bac, self.node_id=f1a8d5bf-f660-472d-b2f8-5a21c0f08bac
2026-10-20 17:01:26, [video.service] - Session created: 9fd711426b480dcc532d4a8f3daf29af, record=True, retain_on_failure=False, file=9fd711426b480dcc532d4a8f3daf29af.mp4
2026-10-20 17:01:27, [video.service] - Started recording: session=9fd711426b480dcc532d4a8f3daf29af, file=9fd711426b480dcc532d4a8f3daf29af.mp4
2026-10-20 17:01:27, [video.service] - Received event: session-closed, nodeId=f1a8d5bf-f660-472d-b2f8-5a21c0f08bac, self.node_id=f1a8d5bf-f660-472d-b2f8-5a21c0f08bac
2026-10-20 17:01:27, [video.service] - Session closed: 9fd711426b480dcc532d4a8f3daf29af, reason=QUIT_COMMAND, is_failed=False
2026-10-20 17:01:27, [video.service] - Stopped recording: session=9fd711426b480dcc532d4a8f3daf29af, duration=0.5s
2026-10-20 17:01:27, [video.service] - Received event: session-created, nodeId=f1a8d5bf-f660-472d-b2f8-5a21c0f08bac, self.node_id=f1a8d5bf-f660-472d-b2f8-5a21c0f08bac
2026-10-20 17:01:27, [video.service] - Session created: e014dfd6f5e08a9f5abee55fd8273ac3, record=True, retain_on_failure=False, file=e014dfd6f5e08a9f5abee55fd8273ac3.mp4
2026-10-20 17:01:28, [video.service] - Started recording: session=e014dfd6f5e08a9f5abee55fd8273ac3, file=e014dfd6f5e08a9f5abee55fd8273ac3.mp4
Operating System

Windows 11 Docker Desktop

Docker Selenium version (image tag)

4.51.0-20261010

Selenium Grid chart version (chart version)

No response

主要语言
Go
星标
8.7k
派生
2.5k
平均合并
2 天 7 小时
30 天内合并 PR
28

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SeleniumHQ/docker-selenium 的其他 Issue

查看 SeleniumHQ/docker-selenium 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。