GDBusProxy: Race condition during initialization of GDBusProxy object.
Submitted by brant.li
Link to original bug (#729232)
Description
Created attachment 275463 The ascii figure that shows the possible execution of this isseus: (Y axis is a time axis)
As far as i knew, the GDBusProxy object initialization flow have two mainly actions:
(1). Listen for properties change signal to update property cache in GDBusProxy. (2). Called the GetAll metod call to get the default value of an object properties.
And I've encountered a race condition with GDBusProxy object initialization. if the signal of properties_change occurred while the GDBusProxy was already in a GetAll reply handler flow, the properties_change signal will be immediately discarded. This causes the GDBusProxy object has not yet initialized when the callback function on_properties_changed() called. ((please see attached file))
I think an easy way to fix this problem is to raising idle GSources priority in whole GetAll reply handler flow, to makesure the on_properties_changed() have been executed after async_init_get_all_cb() and on_proxy_ready(). However this occurs rarely, and in any case the signal of properties changed should not be discarded.
I'm attaching a patch for GDBusProxy below.
Attachment 275463, "The ascii figure that shows the possible execution of this isseus: (Y axis is a time axis)":
Version: 2.40.x