Closed Bug 1588741 Opened 5 years ago Closed 5 years ago

Descriptors.getTarget races when called in parallel

Categories

(DevTools :: Framework, defect, P2)

defect

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

When calling FrameDescriptor.getTarget or ProcessDescriptor.getTarget concurrently, you may have access to a target that is still in process of attaching:
https://searchfox.org/mozilla-central/rev/17756e2a5c180d980a4b08d99f8cc0c97290ae8d/devtools/shared/fronts/descriptors/frame.js#59-60

    if (this._frameTargetFront && this._frameTargetFront.actorID) {
      return this._frameTargetFront; /// <<=== here we may return the unattached target
    }
    if (this._targetFrontPromise) {
      return this._targetFrontPromise;
    }
    this._targetFrontPromise = (async () => {
        ...
        this._frameTargetFront = await this._createFrameTarget(targetForm); // <== here we save the unattached target
        await this._frameTargetFront.attach();

The same pattern is used for processes:
https://searchfox.org/mozilla-central/source/devtools/shared/fronts/descriptors/process.js#66

Attachment #9101230 - Attachment description: Bug 1588741 - Fix a race when calling descriptor.getTarget in parallel. → Bug 1588741 - Descriptors.getTarget may return unattached targets when called in parallel.
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Summary: Descriptots.getTarget races when called in parallel → Descriptors.getTarget races when called in parallel
Priority: -- → P2
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4f546e70e68e Descriptors.getTarget may return unattached targets when called in parallel. r=jdescottes
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: