]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3383: store.cc:1631: "new_status != IN_MEMORY" assertion
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 27 Oct 2011 20:39:23 +0000 (14:39 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 27 Oct 2011 20:39:23 +0000 (14:39 -0600)
UsingSmp() is not the right condition to detect whether we are using a shared
cache because shared memory caching may be disabled and because Coordinator
does not use a shared memory cache even if shared caching is enabled.

The assertion was triggered by icons being added to Coordinator local memory
cache. TODO: Coordinator does not need to cache [icons] at all.

src/store.cc

index f99f864f8d0564e43f60caeb21e93bba1a39d0cb..22df2c87bb3f0dc21f5ee72886a6c3c127cb7eb5 100644 (file)
@@ -1627,7 +1627,8 @@ StoreEntry::setMemStatus(mem_status_t new_status)
     if (new_status == mem_status)
         return;
 
-    if (UsingSmp()) {
+    // are we using a shared memory cache?
+    if (Config.memShared && IamWorkerProcess()) {
         assert(new_status != IN_MEMORY); // we do not call this otherwise
         // This method was designed to update replacement policy, not to
         // actually purge something from the memory cache (TODO: rename?).