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 700238 - Initialize brokers asynchronously
Initialize brokers asynchronously
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
3.8.x
Other Linux
: Normal normal
: 3.22
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
: 744002 747925 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-05-13 17:17 UTC by Zeeshan Ali
Modified: 2016-03-31 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Comment 1 Christophe Fergeau 2013-05-16 14:29:15 UTC
Let's not miss the useful info...


Christophe Fergeau 2013-05-02 18:58:30 UTC

Review of attachment 240755 [details] [review]:

::: src/app.vala
@@ +419,3 @@
+
+        foreach (var source in new_sources)
+            yield add_collection_source (source);

I'm afraid serializing the add_collection_source() call is not very good.
add_collection_source() fetches all the VMs available from source and adds them
to the UI. This can take quite some time with remote sources. If the various
calls are serialized, this means if a slow source is handled before a fast
sourcee, then the VMs from the faster source won't show up until the slow
source is done fetching its VMs.
Using add_collection_source().begin() was more correct imo.

[reply] [-] Comment 47 Zeeshan Ali (Khattak) [gnome-boxes developer] 2013-05-02 21:12:19 UTC

Review of attachment 240755 [details] [review]:

::: src/app.vala
@@ +419,3 @@
+
+        foreach (var source in new_sources)
+            yield add_collection_source (source);

The check for default_connection that follows needs to wait for all
connections/sources to be added (at least until default connection is not
available).

I think add_collection_source() does not necessarily need to do fetch all VMs
etc and it should launch things async as appropriate to return as quickly as
possible.

Alternative would be:

var i = 0;
foreach (var source in new_sources)
   add_collection_source.begin (source, (o, res) => {
       add_collection_source.end (o, res);
       i++;
       if (i == new_sources.length)
          // Check for default_connection availability goes here
    });
Comment 2 Zeeshan Ali 2015-04-15 14:33:38 UTC
*** Bug 747925 has been marked as a duplicate of this bug. ***
Comment 3 Zeeshan Ali 2015-05-06 15:24:58 UTC
*** Bug 744002 has been marked as a duplicate of this bug. ***
Comment 4 Zeeshan Ali 2015-05-13 21:54:36 UTC
commit: 4db7e474872197e65e896bd9f9f5d5d8c9ec468d

    app: Asynchronously setup non-default sources
    
    In case of remote sources, we do not know how long they can take and it
    has been reported that at least in case of libvirt sources, Boxes can
    hang on startup for a long time if such sources are unreachable.