login: ignore new subscribers in session_manager_client during events
session_manager_client uses observer_list which allows reentrancy by default i.e. it allows adding more subscribers while it is firing the events on the observers. One event that causes the problem is when the container is shutdown. When the user is attempts the retry of opt-in flow then we first shutdown the container and then restart the flow by creating a new container. However, when we create a new container, another subscriber is added to session_manager_client and it has not yet completed firing the ArcInstanceStopped event so the new container also is incorrectly detected as shutdown. With this change, we are going to safely invoke the observers and ignore the new subscribers during invocation of events. Currently there are five consumers of the observer interface 1. login_display_host_webui.cc implements OnLoginPromptVisible and plays a sound 2. arc_session_manager.cc implements OnLoginPromptVisible and starts a mini instance. 3. owner_settings_service_chromeos.h implements OwnerKeySet and reloads keys 4. device_settings_service.h implements OwnerKeySet and PropertyChangeComplete and reloads settings 5. arc_container_client_adapter.cc implements ArcInstanceStopped where the problem was occurring initially From the code inspection it is clear that the change should not cause any regression since we're not relying on the same event being fired while handling the event in question for the same instance of container. BUG=b:164816080 TEST=deploy to dut, disable playstore, re-enable playstore, successfully finish the authorization flow Change-Id: Ic820d4f014d5890c68aef99512e38de5acfb0279 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2381050Reviewed-by:Ryo Hashimoto <hashimoto@chromium.org> Reviewed-by:
Hidehiko Abe <hidehiko@chromium.org> Reviewed-by:
Yusuke Sato <yusukes@chromium.org> Commit-Queue: Muhammad Hasan Khan <mhasank@chromium.org> Auto-Submit: Muhammad Hasan Khan <mhasank@chromium.org> Cr-Commit-Position: refs/heads/master@{#804121}
Showing
Please register or sign in to comment