[gnome-builder] diagnostician: add trace message to track active providers



commit fefd3aeab536aaeb9873a1f55553b0d4d40acb58
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jul 17 16:15:13 2016 -0700

    diagnostician: add trace message to track active providers
    
    This can help us track down when the diagnostician is hanging because a
    provider has not completed a task.

 libide/diagnostics/ide-diagnostician.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/libide/diagnostics/ide-diagnostician.c b/libide/diagnostics/ide-diagnostician.c
index 171ff71..ccd5b7f 100644
--- a/libide/diagnostics/ide-diagnostician.c
+++ b/libide/diagnostics/ide-diagnostician.c
@@ -20,6 +20,7 @@
 
 #include <glib/gi18n.h>
 
+#include "ide-debug.h"
 #include "ide-internal.h"
 
 #include "diagnostics/ide-diagnostic-provider.h"
@@ -99,16 +100,21 @@ diagnose_cb (GObject      *object,
 
   ret = ide_diagnostic_provider_diagnose_finish (provider, result, &error);
 
-  if (!ret)
-    goto maybe_complete;
+  if (ret == NULL)
+    {
+      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+        g_warning ("%s", error->message);
+      goto maybe_complete;
+    }
 
   ide_diagnostics_merge (state->diagnostics, ret);
   ide_diagnostics_unref (ret);
 
 maybe_complete:
-  if (state->total == 1 && error != NULL)
-    g_task_return_error (task, g_error_copy (error));
-  else if (state->active == 0)
+  IDE_TRACE_MSG ("%d of %d diagnostic providers active",
+                 state->active, state->total);
+
+  if (state->active == 0)
     g_task_return_pointer (task,
                            g_steal_pointer (&state->diagnostics),
                            (GDestroyNotify)ide_diagnostics_unref);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]