CreateConfiguration invokes callback before GUID lookup works |
|||
Issue descriptionSee b/29456708 While testing components/arc/net/arc_net_host_impl.cc we ran into the following sequence of events: 1) GetManagedConfigurationHandler()->CreateConfiguration() is invoked. 2) Chrome performs an async RequestUpdate to ask shill for the new service's properties. 3) Success callback is invoked with GUID + service path. 4) GetStateHandler()->GetNetworkStateFromGuid(guid) is invoked, but returns nullptr because the properties are unavailable. Therefore the caller cannot determine the service path corresponding to the GUID. 5) RequestUpdate finishes and only *now* is the path available via GetNetworkStateFromGuid(). Some possible solutions: a) GetNetworkStateFromGuid() can return a limited subset of what it knows about the GUID (maybe just the service path). b) Add a new GetServicePathFromGuid() function that doesn't depend on having the full NetworkState struct. Or maybe something equivalent already exists? c) Defer the CreateConfiguration success callback until RequestUpdate completes. d) CreateConfiguration callers should just cache the most recent mapping (which is what we're doing in the short term to pass CTS). Your thoughts?
,
Jul 27 2016
,
Jul 28 2016
For option (c), which observer/callback would you recommend using to figure out whether the new configuration will show up in GetNetworks? Is OnNetworkChanged the best option? I guess this means we'll need to maintain a list of "pending configurations" in arc_net_host_impl and query whether each one exists from the observer callback?
,
Jul 28 2016
See NetworkStateHandlerObserver::NetworkListChanged
,
Aug 12 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by steve...@chromium.org
, Jul 27 2016Labels: OS-Chrome
Owner: cernekee@chromium.org