After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693285 - GDBusObjectManagerClient: won't emit object-added|removed if name-owner arrives later
GDBusObjectManagerClient: won't emit object-added|removed if name-owner arriv...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
2.35.x
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-02-06 22:43 UTC by Aleksander Morgado
Modified: 2013-02-09 19:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program (2.44 KB, text/x-csrc)
2013-02-06 22:43 UTC, Aleksander Morgado
  Details
Patch for the issue (1.72 KB, patch)
2013-02-07 10:00 UTC, Aleksander Morgado
committed Details | Review

Description Aleksander Morgado 2013-02-06 22:43:10 UTC
Created attachment 235343 [details]
Test program

So I've got this GDBusObjectManagerClient created with DO_NOT_AUTO_START. As soon as the manager is created I connect to 'object-added', 'object-removed' and 'notify::name-owner'. See attached example.

If the process providing the well-known name exists BEFORE I create the client; i.e. if the client is created while the service is already there, then I always get 'object-added' and 'object-removed', even after restarts of the service. Example logs:

[aleksander@ares Development]$ ./test-glib 
An object was removed
An object was added
An object was removed
An object was removed
ModemManager disappeared from bus
ModemManager disappeared from bus
ModemManager available in bus (:1.1096)
An object was added
An object was added
An object was removed
An object was removed
ModemManager disappeared from bus

But if the process providing the well-known name does NOT exist before; i.e. the client is created BEFORE the service is launched, then I never get the 'object-added' or 'object-removed' signals.

[aleksander@ares Development]$ ./test-glib 
ModemManager disappeared from bus
ModemManager available in bus (:1.1098)
ModemManager disappeared from bus
ModemManager disappeared from bus
ModemManager available in bus (:1.1099)
Comment 1 Aleksander Morgado 2013-02-07 10:00:22 UTC
Created attachment 235363 [details] [review]
Patch for the issue

Seems that we were only connecting to the control proxy 'g-signal' signal during initiable_init() when there already was a valid name-owner.

With this patch we connect to the control proxy's 'g-signal' even when there is no direct name-owner available.
Comment 2 Matthias Clasen 2013-02-09 18:09:46 UTC
Review of attachment 235363 [details] [review]:

Looks good to me.
Comment 3 Aleksander Morgado 2013-02-09 19:36:09 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.