Blocking call in OnCustomInstall |
|||
Issue descriptionCurrently in component updater, OnCustomInstall handles component specific operations. However, component updater proceeds immediately after OnCustomInstall returns and does not check its progress. It cause a situation where OnCustomInstall is still ongoing while component updater has marked component 'update complete'. To avoid this, I suggest that we force all code in OnCustomInstall executed in a blocking way. Once it returns, component install has been done. An alternative is that we pass a callback to OnCustomInstall which has to be called upon its return to proceed update process.
,
Nov 17 2017
Hi Xiaochu - Sorin and I have been discussing this and we'd like to first make changes to the architecture of the component updater so that failure to call such a callback doesn't DoS the entire update system. I agree this change would be semantically nice, but does it practically stop any harmful races?
,
Nov 17 2017
Thanks, Josh! In our current design, update has priority over any other operations. All other operations (next update, uninstall) are buffered or canceled until current update is done. This is currently our model to handle race (?). But since we have to use non-blocking method call inside OnCustomInstall, this model isn't working exactly. Allowing callback in OnCustomInstall should bring this model integral again. A particular harmful race is load (or uninstall) after install. Sometimes I could observe LoadComponent API fails in the first call due to the case where component is being loaded when component is not fully registered (in OnCustomInstall). This disappears when I make the dbus call (OnCustomInstall) blocking. I never observed race for uninstall after install, but theoretically it could happen like the 'load' case.
,
Dec 4 2017
,
Dec 4 2017
Since component is no longer copied and OnCustomInstall does nothing any more, we do not need to block it any more. |
|||
►
Sign in to add a comment |
|||
Comment 1 by xiaochu@chromium.org
, Nov 14 2017