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 686226 - NMRemoteSettings: fix async initialization
NMRemoteSettings: fix async initialization
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: API
unspecified
Other All
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: 683288
 
 
Reported: 2012-10-16 16:01 UTC by Giovanni Campagna
Modified: 2012-10-16 18:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
NMRemoteSettings: fix async initialization (3.69 KB, patch)
2012-10-16 16:01 UTC, Giovanni Campagna
reviewed Details | Review
NMRemoteSettings: fix async initialization (3.11 KB, patch)
2012-10-16 17:34 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-10-16 16:01:15 UTC
If async GetProperties completed before the GetConnections, init_left would
be 0 and thus we never connected to connections-read, causing us to terminate
initialization before connections were actually read.
Comment 1 Giovanni Campagna 2012-10-16 16:01:18 UTC
Created attachment 226564 [details] [review]
NMRemoteSettings: fix async initialization
Comment 2 Dan Winship 2012-10-16 16:57:19 UTC
Comment on attachment 226564 [details] [review]
NMRemoteSettings: fix async initialization

>@@ -739,6 +744,7 @@ name_owner_changed (DBusGProxy *proxy,
> 			g_source_remove (priv->fetch_id);
> 
> 		if (new_owner && strlen (new_owner) > 0) {
>+			priv->fetching = TRUE;

This doesn't seem necessary; fetching is only checked during async init.

>+	priv->inited = TRUE;
> 	init_async_complete (init_data);

>+	priv->inited = TRUE;
> 	init_async_complete (init_data);

You could just set priv->inited in init_async_complete(); it doesn't matter whether or not inited gets set TRUE in the case where init_async() fails, because the caller is required to destroy the object immediately in that case anyway.


Can you make sure the patch still works with those changes?


>diff --git a/src/nm-device.c b/src/nm-device.c

unrelated...
Comment 3 Giovanni Campagna 2012-10-16 17:20:34 UTC
(In reply to comment #2)
> (From update of attachment 226564 [details] [review])
> >@@ -739,6 +744,7 @@ name_owner_changed (DBusGProxy *proxy,
> > 			g_source_remove (priv->fetch_id);
> > 
> > 		if (new_owner && strlen (new_owner) > 0) {
> >+			priv->fetching = TRUE;
> 
> This doesn't seem necessary; fetching is only checked during async init.

In theory though, name_owner_changed could be emitted before the connections were read completely, and thus start a new round of fetching.

> 
> 
> >diff --git a/src/nm-device.c b/src/nm-device.c
> 
> unrelated...

Take it as a hint :)
Comment 4 Dan Winship 2012-10-16 17:24:07 UTC
(In reply to comment #3)
> Take it as a hint :)

why, what's wrong with the current IP?
Comment 5 Giovanni Campagna 2012-10-16 17:33:36 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Take it as a hint :)
> 
> why, what's wrong with the current IP?

Nothing, except that it's the same in every NetworkManager, so when I need two levels of NATs (say, one pc connected to paid wifi, sharing via ethernet, the other creating a wifi hotspot for more people to join) I need to hand patch NM.
I would be happier if it was random or configurable somehow, but I understand my configuration is a bit esoteric.
Comment 6 Giovanni Campagna 2012-10-16 17:34:50 UTC
Created attachment 226574 [details] [review]
NMRemoteSettings: fix async initialization

If async GetProperties completed before the GetConnections, init_left would
be 0 and thus we never connected to connections-read, causing us to terminate
initialization before connections were actually read.
Comment 7 Dan Winship 2012-10-16 18:32:28 UTC
Attachment 226574 [details] pushed as 246633a - NMRemoteSettings: fix async initialization