As seen at least for bug 1347456 from Treeherder but also noticed locally a couple of times, we have hangs in the driver when a remoteness change occurred and the communiction with the framescript happened via the dispatcher while the command hasn't queued in pendingCommands. This is clearly a serious issue and can happen at various times when a command triggers a page load and Marionette doesn't wait for it to be finished. Please note that right now we only wait for that in get(), goBack(), and goForward(). But nowhere else. I will try to setup a testcase for that which actually might not be that hard.
Trying to reproduce with current code is hard, but if we exclude a page load for file:// urls in navigate.js, the following snippet will promptly cause a hang all the times: def test(self): self.marionette.navigate("file:///") self.marionette.get_url() The call to get_url() never returns, and Marionette runs into the socket timeout.
Btw. there seem to be events we might be able to use to get informed about a remoteness change. Those are BeforeTabRemotenessChange and TabRemotenessChange. Maybe we should listen to the events and re-send the message to the listener once the remoteness change has been completed.
Something which also helps here is to ensure that every possible navigation request is clearly routed through the loadListener. But this is something we cannot always expect, eg. if the user presses enter on a submit button. In such a case a new page is most likely to get loaded, and the following command will fail to execute due to a possible remoteness change.
5 months ago