aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-backend.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-04-19 02:38:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-04-19 03:56:57 +0800
commitcb90b0a9e9bfb27f97b68682ff03d4ae5e3ea390 (patch)
tree9e8b5f3287e8ebf736847d7dd908f75d9ec488ed /shell/e-shell-backend.c
parent87a77c8e61892d048b3b49a9a6a1741a4b92df54 (diff)
downloadgsoc2013-evolution-cb90b0a9e9bfb27f97b68682ff03d4ae5e3ea390.tar
gsoc2013-evolution-cb90b0a9e9bfb27f97b68682ff03d4ae5e3ea390.tar.gz
gsoc2013-evolution-cb90b0a9e9bfb27f97b68682ff03d4ae5e3ea390.tar.bz2
gsoc2013-evolution-cb90b0a9e9bfb27f97b68682ff03d4ae5e3ea390.tar.lz
gsoc2013-evolution-cb90b0a9e9bfb27f97b68682ff03d4ae5e3ea390.tar.xz
gsoc2013-evolution-cb90b0a9e9bfb27f97b68682ff03d4ae5e3ea390.tar.zst
gsoc2013-evolution-cb90b0a9e9bfb27f97b68682ff03d4ae5e3ea390.zip
EShellBackend: Log outstanding activities during shutdown.
Log debug messages for outstanding activities during shutdown to help investigate stuck shutdown issues. Enable this feature with: G_MESSAGES_DEBUG=evolution-shell (cherry picked from commit fd6ff38fbd6dc82fe16c157dbdb4602b3277abfa)
Diffstat (limited to 'shell/e-shell-backend.c')
-rw-r--r--shell/e-shell-backend.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c
index 31e3809903..0749aac4e6 100644
--- a/shell/e-shell-backend.c
+++ b/shell/e-shell-backend.c
@@ -82,6 +82,40 @@ static guint signals[LAST_SIGNAL];
G_DEFINE_ABSTRACT_TYPE (EShellBackend, e_shell_backend, E_TYPE_EXTENSION)
static void
+shell_backend_debug_list_activities (EShellBackend *shell_backend)
+{
+ EShellBackendClass *class;
+ GList *head, *link;
+ guint n_activities;
+
+ class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+
+ n_activities = g_queue_get_length (shell_backend->priv->activities);
+
+ if (n_activities == 0)
+ return;
+
+ g_debug (
+ "%u active '%s' %s:",
+ n_activities, class->name,
+ (n_activities == 1) ? "activity" : "activities");
+
+ head = g_queue_peek_head_link (shell_backend->priv->activities);
+
+ for (link = head; link != NULL; link = g_list_next (link)) {
+ EActivity *activity = E_ACTIVITY (link->data);
+ gchar *description;
+
+ description = e_activity_describe (activity);
+ if (description != NULL)
+ g_debug ("* %s", description);
+ else
+ g_debug ("* (no description)");
+ g_free (description);
+ }
+}
+
+static void
shell_backend_activity_finalized_cb (EShellBackend *shell_backend,
EActivity *finalized_activity)
{
@@ -99,6 +133,8 @@ shell_backend_notify_busy_cb (EShellBackend *shell_backend,
GParamSpec *pspec,
EActivity *activity)
{
+ shell_backend_debug_list_activities (shell_backend);
+
if (!e_shell_backend_is_busy (shell_backend)) {
/* Disconnecting this signal handler will unreference the
* EActivity and allow the shell to proceed with shutdown. */
@@ -114,6 +150,8 @@ shell_backend_prepare_for_quit_cb (EShell *shell,
EActivity *activity,
EShellBackend *shell_backend)
{
+ shell_backend_debug_list_activities (shell_backend);
+
if (e_shell_backend_is_busy (shell_backend)) {
gulong handler_id;