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 727549 - dconf-service hangs shutdown
dconf-service hangs shutdown
Status: RESOLVED FIXED
Product: dconf
Classification: Core
Component: general
0.16.x
Other Linux
: Normal normal
: ---
Assigned To: dconf-maint
dconf-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-03 16:10 UTC by Marek Kašík
Modified: 2014-04-04 14:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't hang during shutdown (1.08 KB, patch)
2014-04-03 16:10 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2014-04-03 16:10:50 UTC
Created attachment 273537 [details] [review]
Don't hang during shutdown

dconf-service refuses to quit when it receives SIGTERM followed by SIGHUP. This can happen during shutdown. Steps to reproduce are:

1) log as an user to Gnome session
2) switch to another user by using the "Switch User" menu item
3) poweroff the system by using the "Power Off" menu item
4) wait

It doesn't hang everytime (it hangs for me 2-3x during 5 attempts). You can see that the component which hangs the shutdown is dconf by turning the systemd's debugging on and looking at the log (see http://freedesktop.org/wiki/Software/systemd/Debugging/#index2h1).

This happens because dconf-service calls g_application_release() twice (because of the SIGTERM and SIGHUP) but it called g_application_hold() just once before.
The attached patch fixes this for me.

I'll file a bug for Glib to add an assert to the g_application_release().

Regards

Marek
Comment 1 Allison Karlitskaya (desrt) 2014-04-04 13:37:16 UTC
Review of attachment 273537 [details] [review]:

Nice catch.  Please feel free to commit after the trivial fix.

::: service/dconf-service.c
@@ +41,3 @@
   GArray      *subtree_ids;
+
+  gboolean     signalized;

Can you rename this to something more reasonable, like "released" or "exiting"?
Comment 2 Marek Kašík 2014-04-04 14:00:45 UTC
Comment on attachment 273537 [details] [review]
Don't hang during shutdown

(In reply to comment #1)
> Review of attachment 273537 [details] [review]:
> 
> Nice catch.  Please feel free to commit after the trivial fix.
> 
> ::: service/dconf-service.c
> @@ +41,3 @@
>    GArray      *subtree_ids;
> +
> +  gboolean     signalized;
> 
> Can you rename this to something more reasonable, like "released" or "exiting"?

Thank you for the review. I used "released" for the name of the variable.

I've pushed the patch to master. Do you want me to push it also to a stable branch?

Marek
Comment 3 Allison Karlitskaya (desrt) 2014-04-04 14:14:32 UTC
Yes please.
Comment 4 Marek Kašík 2014-04-04 14:23:11 UTC
Thank you. I've pushed it to dconf-0-18.