Repository navigation
fix(cdpmonitor): stop attaching to shared workers - #496
Closed
RyoKusnadi wants to merge 1 commit into
Closed
RyoKusnadi wants to merge 1 commit into
RyoKusnadi wants to merge 1 commit into
Conversation
Attaching a DevTools session to a shared_worker target can crash Chrome (SEGV in SharedWorkerDevToolsAgentHost) when the page that owns the worker closes. Drop shared_worker from the monitor's tracked target types and from the e2e worker cases that relied on it. Signed-off-by: Ryo Kusnadi <ryokusnadi@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The CDP network monitor no longer tracks
shared_workertargets.Why
As described in the issue, the monitor attaches a DevTools session to every shared worker. Chrome can then crash (
SEGVinSharedWorkerDevToolsAgentHost) when the page owning the worker closes while the session is attached. Shared workers add little to network telemetry, so I took the option the issue suggests and left them out by default.Changes
cdpmonitor/monitor.go: removeshared_workerfromWithAdditionalTargets, with a comment saying why.monitor_test.go: the discovery filter no longer listsshared_worker.shared_workercase, since it is no longer tracked.Testing
go test ./lib/cdpmonitor/... ./lib/browsersurface/...passes. I did not run the Chrome e2e tests, so the crash itself is not reproduced here.Fixes #485
Note
Medium Risk
Narrows which worker targets receive network telemetry and interaction hooks, but avoids a known Chrome crash path; dedicated and service workers remain covered.
Overview
Stops the CDP monitor from discovering and attaching DevTools sessions to
shared_workertargets, leavingworker,service_worker, andbackground_pagetracked as before.The change is driven by a Chrome crash (
SEGVinSharedWorkerDevToolsAgentHost) when the owning page closes while a session remains attached; shared workers are excluded because they add little network telemetry.monitor.godocuments that rationale in a comment next toWithAdditionalTargets.Unit and Chrome e2e tests are updated so target discovery expectations and worker coverage no longer assume
shared_workeris monitored.Reviewed by Cursor Bugbot for commit ad22e12. Bugbot is set up for automated code reviews on this repo. Configure here.