This is spin off from internal bug where attempting to cast to Cast EDU causes an indefinite spinner, and extension-related functionalities no longer work (e.g. no devices found) afterwards. This is not a new regression, but rather have existed for a while and is a somewhat uncommon occurrence. We will track the cause of extension crash separately.
(1) the extension is suspected to crash during the request to cast. This causes the Mojo message pipes between the extension and ExtensionMediaRouteProviderProxy to error out, and the CreateRoute request is unfulfilled (i.e. callback supplied to extension was dropped).
(2) ExtensionMediaRouteProviderProxy itself implements the MediaRouteProvider interface. MediaRouter calls CreateRoute on it, and it calls CreateRoute on the MR extension, passing through the supplied callback. This means when (1) happens, the MediaRouter's CreateRoute callback is dropped as well. This results in a Mojo connection error between MediaRouter and EMRPP and is currently unrecoverable.
(3) Note it is possible to reach this bad state via other means, such as if a queued request with a Mojo callback gets dropped.
We could fix this in one of following ways:
(1) add a layer of indirection in EMRPP for all MediaRouteProvider methods that has a callback by wrapping the callbacks and tracking them. When an extension error is detected, invoke the pending callbacks with failure values. This ensures EMRPP always answers callbacks regardless of extension state.
(2) let the mojo connection error propagate back to MediaRouter. Let MediaRouter detects this case and recreate the Mojo message pipe to ExtensionMediaRouteProviderProxy. Cap this to a maximum number of attempts and send issue. Also record to metrics when this happens.
Comment 1 by bugdroid1@chromium.org
, Jul 12