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 653999 - g_app_info_get_default_for_type not always returning the right result
g_app_info_get_default_for_type not always returning the right result
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-07-05 10:49 UTC by Florian Boucault
Modified: 2018-05-24 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Reader Program (148 bytes, text/x-python)
2011-07-05 10:49 UTC, Florian Boucault
Details
Setter Program (446 bytes, text/x-python)
2011-07-05 10:49 UTC, Florian Boucault
Details

Description Florian Boucault 2011-07-05 10:49:11 UTC
Created attachment 191285 [details]
Reader Program

After a g_app_info_set_as_default_for_type in one process, doing g_app_info_get_default_for_type in another will not return the correct result.

See programs attached for a clear example of what happens.

Run set_default.py which will periodically set the default for a given type and run in parallel get_default.py which will periodically get the default for the same type. The results are inconsistent.
Comment 1 Florian Boucault 2011-07-05 10:49:30 UTC
Created attachment 191286 [details]
Setter Program
Comment 2 Florian Boucault 2011-07-05 15:15:32 UTC
These results come from gdesktopappinfo.c:2942, function mime_info_cache_init that only update the cache if the current time is 10 seconds in the future from the last update:

[...]
      time (&now);
      if (now >= mime_info_cache->last_stat_time + 10)
    {
      mime_info_cache_update_dir_lists ();
      mime_info_cache->last_stat_time = now;
    }
[...]
Comment 3 GNOME Infrastructure Team 2018-05-24 13:12:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/420.