IndexedDB requests issued during shutdown can result in hanging shutdown.
Categories
(Core :: Storage: IndexedDB, defect, P2)
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.
Comment 1•6 years ago
|
||
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?
Comment 2•6 years ago
|
||
I suspect we get a note, but we return null actor here:
https://searchfox.org/mozilla-central/rev/efdf9bb55789ea782ae3a431bda6be74a87b041e/dom/indexedDB/ActorsParent.cpp#12651
See also:
https://searchfox.org/mozilla-central/source/__GENERATED__/ipc/ipdl/PBackgroundIDBFactoryParent.cpp#364
https://searchfox.org/mozilla-central/rev/efdf9bb55789ea782ae3a431bda6be74a87b041e/ipc/glue/MessageChannel.cpp#2535
Comment 3•6 years ago
|
||
We could return a very simple actor in that case which just sends an error back to the child.
Reporter | ||
Comment 4•6 years ago
|
||
(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.
Updated•5 years ago
|
Description
•