]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
store_dirs_rebuilding should be initialized to 1
authorwessels <>
Tue, 10 Apr 2007 06:45:10 +0000 (06:45 +0000)
committerwessels <>
Tue, 10 Apr 2007 06:45:10 +0000 (06:45 +0000)
store_dirs_rebuilding is initialized to _1_ as a hack so that
storeDirWriteCleanLogs() doesn't try to do anything unless _all_
cache_dirs have been read.  For example, without this hack, Squid
will try to write clean log files if -kparse fails (becasue it
calls fatal()).

src/store_dir.cc
src/store_rebuild.cc

index a7449e873e69884d40170b360fff35659a8b5a50..0ec77afcb5acebbaefe99d8c51d3d7ec80362f1f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.156 2006/08/21 00:50:41 robertc Exp $
+ * $Id: store_dir.cc,v 1.157 2007/04/10 00:45:10 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
 static STDIRSELECT storeDirSelectSwapDirRoundRobin;
 static STDIRSELECT storeDirSelectSwapDirLeastLoad;
 
-int StoreController::store_dirs_rebuilding = 0;
+/*
+ * store_dirs_rebuilding is initialized to _1_ as a hack so that
+ * storeDirWriteCleanLogs() doesn't try to do anything unless _all_
+ * cache_dirs have been read.  For example, without this hack, Squid
+ * will try to write clean log files if -kparse fails (becasue it
+ * calls fatal()).
+ */
+int StoreController::store_dirs_rebuilding = 1;
 
 StoreController::StoreController() : swapDir (new StoreHashIndex())
 {}
index 41513ccf8ac3575272c7ae81250641013173415f..d073c6fcf9e5cd8fd1419ec390074abfbd7163a8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_rebuild.cc,v 1.86 2006/08/19 12:31:21 robertc Exp $
+ * $Id: store_rebuild.cc,v 1.87 2007/04/10 00:45:10 wessels Exp $
  *
  * DEBUG: section 20    Store Rebuild Routines
  * AUTHOR: Duane Wessels
@@ -113,6 +113,7 @@ storeCleanup(void *datanotused)
         debugs(20, 1, "  Completed Validation Procedure");
         debugs(20, 1, "  Validated " << validated << " Entries");
         debugs(20, 1, "  store_swap_size = " << store_swap_size);
+       StoreController::store_dirs_rebuilding--;
         assert(0 == StoreController::store_dirs_rebuilding);
 
         if (opt_store_doublecheck)
@@ -143,7 +144,7 @@ storeRebuildComplete(struct _store_rebuild_data *dc)
     counts.bad_log_op += dc->bad_log_op;
     counts.zero_object_sz += dc->zero_object_sz;
     /*
-     * When store_dirs_rebuilding == 0, it means we are done reading
+     * When store_dirs_rebuilding == 1, it means we are done reading
      * or scanning all cache_dirs.  Now report the stats and start
      * the validation (storeCleanup()) thread.
      */
@@ -194,7 +195,7 @@ storeRebuildStart(void)
     memset(&counts, '\0', sizeof(counts));
     rebuild_start = current_time;
     /*
-     * Note: store_dirs_rebuilding is initialized to 0.
+     * Note: store_dirs_rebuilding is initialized to 1.
      *  
      * When we parse the configuration and construct each swap dir, 
      * the construction of that raises the rebuild count.