Closed Bug 1607692 Opened 4 years ago Closed 4 years ago

QM: Investigate why the storage connection is sometimes not closed in QuotaManager::~QuotaManager

Categories

(Core :: Storage: Quota Manager, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: janv, Assigned: janv)

References

Details

Attachments

(2 files)

We found this issue in bug 1604005 and we need to do more investigation.

In general, QuotaManager::ShutdownStorage triggers flushing of not yet committed data to disk and closing of files correctly, so it is quite important that it runs before QuotaManager object is destroyed.

I think I know why this can happen, I'll describe it in next comment.

Summary: QM: Investigate why the storage connection is sometimes not closed in QuotaManager::ShutdownStorage → QM: Investigate why the storage connection is sometimes not closed in QuotaManager::~QuotaManager
See Also: → 1604005
Priority: -- → P2

I think the real problem is that we don't wait for StorageOperationBase objects to finish in QuotaManager::Shutdown before we schedule a runnable to QM I/O thread for calling QuotaManager::ShutdownStorage which closes the storage connection.

We need to add tracking of these objects, so we spin the event loop in QuotaManager::Shutdown until these objects are finished.

I'll try to create a patch for this.

Assignee: nobody → jvarga
Status: NEW → ASSIGNED

These methods never return false, so they can be safely converted to return void.

Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/177f23c6bc89
Change return type of QuotaUsageRequestBase::Init and QuotaRequestBase::Init from bool to void; r=dom-workers-and-storage-reviewers,ttung
https://hg.mozilla.org/integration/autoland/rev/9793a4979340
Wait for all normal origin operations to finish before shutting down QuotaManager; r=dom-workers-and-storage-reviewers,ttung
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: