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 683288 - NetworkMenu: use async initialization for libnm-glib objects
NetworkMenu: use async initialization for libnm-glib objects
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 686226
Blocks:
 
 
Reported: 2012-09-03 18:00 UTC by Giovanni Campagna
Modified: 2013-02-15 20:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
NetworkMenu: use async initialization for libnm-glib objects (6.76 KB, patch)
2012-09-03 18:00 UTC, Giovanni Campagna
reviewed Details | Review
NetworkMenu: use async initialization for libnm-glib objects (6.33 KB, patch)
2012-10-16 16:02 UTC, Giovanni Campagna
reviewed Details | Review
NetworkMenu: use async initialization for libnm-glib objects (8.03 KB, patch)
2013-02-15 20:29 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-09-03 18:00:56 UTC
Just a passing by fix.
Comment 1 Giovanni Campagna 2012-09-03 18:00:59 UTC
Created attachment 223354 [details] [review]
NetworkMenu: use async initialization for libnm-glib objects

NMClient recently got more heavyweight, with a property holding supported
connections. As fully initializing a NMObject is a recursive operation
and requires multiple DBus calls, switch to async initalization for NMClient
and NMRemoteSettings.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-09-03 18:07:52 UTC
(In reply to comment #1)
> Created an attachment (id=223354) [details] [review]
> NetworkMenu: use async initialization for libnm-glib objects
> 
> NMClient recently got more heavyweight, with a property holding supported
> connections.

Does this mean that we can drop a lot of random code?
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-09-03 18:09:25 UTC
Review of attachment 223354 [details] [review]:

::: js/ui/status/network.js
@@ +1850,3 @@
             let connectionPath = activeConnections[i].connection;
             let connection = this._settings.get_connection_by_path(connectionPath)
+            if (!connection || this._ignoreConnection(connection))

This seems wrong to me.
Comment 4 Giovanni Campagna 2012-09-03 18:15:35 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Created an attachment (id=223354) [details] [review] [details] [review]
> > NetworkMenu: use async initialization for libnm-glib objects
> > 
> > NMClient recently got more heavyweight, with a property holding supported
> > connections.
> 
> Does this mean that we can drop a lot of random code?

Yes. Except that to do so, we need to introduce more random code to sync this array property, so it's not a big gain, really. I may do it at some time in the future, maybe for 3.6.1, maybe for 3.7.1.
Comment 5 Giovanni Campagna 2012-10-16 16:02:38 UTC
Created attachment 226565 [details] [review]
NetworkMenu: use async initialization for libnm-glib objects

NMClient recently got more heavyweight, with a property holding supported
connections. As fully initializing a NMObject is a recursive operation
and requires multiple DBus calls, switch to async initalization for NMClient
and NMRemoteSettings.

That bit was caused by NM bug 686226, I removed it now that I found the right fix.
Comment 6 Giovanni Campagna 2013-01-18 23:52:17 UTC
So, while is not complete as we wish, is there any chance to merge it?
Comment 7 Matthias Clasen 2013-02-12 04:22:08 UTC
Dan, would you be the right person to review this ?
Comment 8 Dan Winship 2013-02-12 15:36:42 UTC
Comment on attachment 226565 [details] [review]
NetworkMenu: use async initialization for libnm-glib objects

>NMClient recently got more heavyweight, with a property holding supported
>connections.

NMClient has a property holding active connections, but not "supported" connections... you might be mixing up NMClient and NMRemoteSettings?

And none of these properties are new; the change is that since 0.9.6, NMClient does a blocking GetAll() at construct time to initialize all properties, rather than doing a separate blocking Get() for each individual property the first time you access it.


Anyway, the actual code looks right.
Comment 9 Giovanni Campagna 2013-02-12 15:41:19 UTC
I was referring to AvailableConnections on NMDevice, which was new when I wrote the patch, and was the first time the NMClient hierarchy loaded connections.
Comment 10 Dan Winship 2013-02-12 16:05:57 UTC
(In reply to comment #9)
> I was referring to AvailableConnections on NMDevice, which was new when I wrote
> the patch

Huh, never saw that... but anyway, that was added to the D-Bus API, but not to libnm-glib, so NMDevice will just ignore it. (It will receive the property value in the original GetAll(), but it won't try to recursively resolve its contents.)
Comment 11 Giovanni Campagna 2013-02-15 20:29:51 UTC
Created attachment 236293 [details] [review]
NetworkMenu: use async initialization for libnm-glib objects

NMClient recently got more heavyweight, with a property holding supported
connections. As fully initializing a NMObject is a recursive operation
and requires multiple DBus calls, switch to async initalization for NMClient
and NMRemoteSettings.

Rebased, per Bastien's request in bug 687853.
Btw, Dan, you said the code looks right, and since that you fixed NM
to available-connections exists now. Can I land this one?
Comment 12 Dan Winship 2013-02-15 20:32:23 UTC
Comment on attachment 236293 [details] [review]
NetworkMenu: use async initialization for libnm-glib objects

yeah, still looks right to me
Comment 13 Giovanni Campagna 2013-02-15 20:38:31 UTC
Ok, let's get this in now.
Attachment 236293 [details] pushed as 382cc52 - NetworkMenu: use async initialization for libnm-glib objects