ResourceCommand's watchResources and unwatchResource still have race conditions
Categories
(DevTools :: Framework, defect, P1)
Tracking
(Fission Milestone:M7a, firefox90 fixed)
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
(Whiteboard: dt-fission-m3-mvp)
Attachments
(5 files)
Bug 1708635 highlighted a race condition that still exists between watchResources and unwatchResources:
https://treeherder.mozilla.org/logviewer?job_id=338677989&repo=autoland&lineNumber=6500
[task 2021-05-04T14:50:19.411Z] 14:50:19 INFO - TEST-PASS | devtools/client/responsive/test/browser/browser_device_change.js | UA should be set to Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0 -
[task 2021-05-04T14:50:19.414Z] 14:50:19 INFO - Closing responsive design mode
[task 2021-05-04T14:50:19.700Z] 14:50:19 INFO - GECKO(1513) | console.error: "Exception while calling a ResourceCommand" "available" "callback" ":" (new Error("Stopped listening for resource 'document-event' that isn't being listened to", "resource://devtools
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
This isn't solely for performance reason.
This will help ensure calling _startListening synchronously when calling watchResources.
This is to help simplify the various states store to track which resources are being watched.
And ultimately fix races between watch and unwatch.
Assignee | ||
Comment 2•4 years ago
|
||
Assignee | ||
Comment 3•4 years ago
|
||
Calling it twice in a raw makes it never resolve.
The actor implementation could probably be made more resilient,
but memoizing it on the front would probably help reduce the number of request we are doing.
This issues appears with the first changeset, parellizing the call to ResourceCommand._startListening.
Assignee | ||
Comment 4•4 years ago
|
||
This is the ultimate change in order to ensure calling _startListening
synchronously from watchResources.
Fixes are required to styles tests, as watchAllTarget is only called if we pass a valid resource type.
Assignee | ||
Comment 5•4 years ago
|
||
Now that _startListening is synchronous, we can fix the race conditions
that exists between many calls made to watch and unwatch resources.
And we would benefit from simplifying the various ways to track
what resources is being watched.
We no either use _watchers and _pendindWatchers to have the live number
of registered listeners. And in parellel to that, only record
which resources is being watched on the server via _listenedResources.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 7•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e47322fa2d09
https://hg.mozilla.org/mozilla-central/rev/accb5722566d
https://hg.mozilla.org/mozilla-central/rev/a239123a371a
https://hg.mozilla.org/mozilla-central/rev/9f6b42ce7f5d
https://hg.mozilla.org/mozilla-central/rev/54ac35a2ef29
Description
•