[ostree] pull: Add a few more g_debug() and assertions



commit 3ce687ef1bb96451009f62741ec77da0c309f393
Author: Colin Walters <walters verbum org>
Date:   Sun Jan 19 12:39:18 2014 -0500

    pull: Add a few more g_debug() and assertions
    
    To help track down the race condition better.

 src/libostree/ostree-repo-pull.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 5a3220b..9fe0675 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -901,6 +901,7 @@ on_metadata_objects_to_scan_ready (gint         fd,
       else if (msg->t == PULL_MSG_QUIT)
         {
           g_free (msg);
+          g_debug ("pull: Processing PULL_MSG_QUIT");
           g_main_loop_quit (pull_data->metadata_thread_loop);
         }
       else
@@ -908,10 +909,14 @@ on_metadata_objects_to_scan_ready (gint         fd,
       }
     
   if (last_idle_msg)
-    ot_waitable_queue_push (pull_data->metadata_objects_to_fetch,
-                            last_idle_msg);
+    {
+      g_debug ("pull: Processing PULL_MSG_MAIN_IDLE");
+      ot_waitable_queue_push (pull_data->metadata_objects_to_fetch,
+                              last_idle_msg);
+    }
   
   /* When we have no queue to process, notify the main thread */
+  g_debug ("pull: Sending SCAN_IDLE");
   ot_waitable_queue_push (pull_data->metadata_objects_to_fetch,
                           pull_worker_message_new (PULL_MSG_SCAN_IDLE, GUINT_TO_POINTER (0)));
 
@@ -1401,6 +1406,10 @@ ostree_repo_pull (OstreeRepo               *self,
   if (!run_mainloop_monitor_fetcher (pull_data))
     goto out;
   
+  g_assert_cmpint (pull_data->n_outstanding_metadata_fetches, ==, 0);
+  g_assert_cmpint (pull_data->n_outstanding_metadata_write_requests, ==, 0);
+  g_assert_cmpint (pull_data->n_outstanding_content_fetches, ==, 0);
+  g_assert_cmpint (pull_data->n_outstanding_content_write_requests, ==, 0);
 
   g_hash_table_iter_init (&hash_iter, updated_refs);
   while (g_hash_table_iter_next (&hash_iter, &key, &value))


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