Open Bug 1597312 Opened 6 years ago Updated 5 years ago

IndexedDB requests issued during shutdown can result in hanging shutdown.

Categories

(Core :: Storage: IndexedDB, defect, P2)

defect

Tracking

()

People

(Reporter: asuth, Unassigned)

References

Details

From https://bugzilla.mozilla.org/show_bug.cgi?id=1594521#c8:

[task 2019-11-15T21:33:01.321Z] 21:33:01 INFO - PID 5331 | ###!!! [Parent][DispatchAsyncMessage] Error: PBackgroundIDBFactory::Msg_PBackgroundIDBFactoryRequestConstructor Value error: message was deserialized, but contained an illegal value

It's likely when the above happens that PBackground ends up in a weird state. While I believe that scenario was using IDB from a worker, there's no fundamental reason this couldn't also happen from the main thread.

AFAIK, if this happens, the dom/indexedDB/ActorsParent.cpp code gets no note of the message, but it is silently handled with the MessageChannel. I am not sure if we can do anything in that case unless some notification mechanism is added to the IPC layer.

Or are you suggesting to prevent such an illegal message to be sent? To better understand what's happening, we would need to get the content of the message.

Do you know some way to reproduce this, such we can debug it?

Flags: needinfo?(bugmail)

We could return a very simple actor in that case which just sends an error back to the child.

(In reply to Simon Giesecke [:sg] [he/him] from comment #1)

Do you know some way to reproduce this, such we can debug it?

So, the situation from bug 1594521 was basically a ChromeWorker that uses IndexedDB after the "profile-before-change-qm" phase of existence happens. It sounds like if you just checkout one of the revisions from that bug without the fix to make remote settings properly shutdown, it can be reproduced. To more explicitly create it, I think one would want to:

  • Add some chrome-privileged JS code that:
    • Creates a ChromeWorker.
    • Adds an observer for "profile-before-change-telemetry", the phase immediately after "profile-before-change-qm". (callsite) that postMessages the ChromeWorker.
    • Have that worker code attempt to open a database.
  • Run firefox, shutdown should hang at worker shutdown because the worker isn't allowed to shutdown because of the pending open which prevents "xpcom-shutdown-threads" or perhaps' the worker's runtimeservice.
Flags: needinfo?(bugmail)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.