Web/Plugin process deadlock initializing async plugins Imagine: -A WebProcess is instantiating a plugin, so it synchronously asks for a new plugin process connection. -Once it gets the connection, it asynchronously asks for a plugin to initialize. -While that one is initializing, it's instantiating another plugin. -It synchronously asks for a new plugin process connection. In this scenario, when the plugin process finishes up the async initialization, it notifies the web process with a synchronous message. So it's synchronously waiting on the WebProcess, and the WebProcess is synchronously waiting on the plugin process. Deadlock. I think this is an easy fix because I don't now why the plugin process notification to the WebProcess is synchronous - the replies are empty. In radar as <rdar://problem/13525232>
Created attachment 196954 [details] Patch v1
http://trac.webkit.org/changeset/147953
This caused platform/mac-wk2/plugins/slow/asynchronous-plugin-initialization-multiple.html to fail. Looking in to it now.
Here's what happens in the test: 1 - PluginProcess gets 20 requests to async init. Those 20 messages are queued up. 2 - It starts the first 1, which takes 0.5 seconds 3 - During that time, the WebProcess tells it to destroy all of them. These 20 messages are sync messages, and presumably get queued up behind those 20 in step one. In the working case, those 20 "Destroy" messages are handled immediately after the first plugin is finished initializing, even though there's 19 requests to create waiting. In the failing case, all 20 requests to create are handled before any of the requests to destroy are handled.
Skipped in r147968 while I explore this.
Reopening - the failure shows the patch broke the async plugin feature.
This probably wasn't necessary, and we should roll it out.
Rolled out in http://trac.webkit.org/changeset/148214