Closed Bug 1794376 Opened 2 years ago Closed 2 years ago

CacheFileIOManager's ShutdownEvent should use SpinEventLoopUntil

Categories

(Core :: Networking: Cache, task, P2)

task

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: jstutte, Assigned: valentin)

References

Details

(Whiteboard: [necko-triaged][necko-priority-queue])

Attachments

(2 files)

Currently we have in PostAndWait the following blocking loop:

    TimeDuration waitTime = TimeDuration::FromSeconds(1);
    while (!mNotified) {
      mon.Wait(waitTime);
      if (!mNotified) {
        // If there is any IO blocking on the IO thread, this will
        // try to cancel it.  Returns no later than after two seconds.
        MonitorAutoUnlock unmon(mMonitor);  // Prevent delays
        CacheFileIOManager::gInstance->mIOThread->CancelBlockingIO();
      }
    }

which is (potentially) executed on the main thread and might lead to a hang.

We probably want to use a SpinEventLoopUntil here and maybe revisit also BlockingIOWatcher::WatchAndCancel.

See Also: → 1790983
Severity: -- → N/A
Priority: -- → P2
Whiteboard: [necko-triaged][necko-priority-review]
Assignee: nobody → valentin.gosu
Whiteboard: [necko-triaged][necko-priority-review] → [necko-triaged][necko-priority-queue]
Blocks: 1402724
Attachment #9299459 - Attachment description: Bug 1794376 - Remove BlockingIOWatcher and simplify code r=#necko → Bug 1794376 - Rename BlockingIOWatcher and simplify code r=#necko
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b92724a7bcb6 Use SpinEventLoopUntil to await for CacheFileIOManager shutdown r=jstutte,edgul https://hg.mozilla.org/integration/autoland/rev/43b8474c2eae Rename BlockingIOWatcher and simplify code r=edgul
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
See Also: → 1800864
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: