]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 3449: shm_open failed (part 4: fixing memory_cache_shared defaults)
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 26 Jan 2012 14:52:35 +0000 (07:52 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 26 Jan 2012 14:52:35 +0000 (07:52 -0700)
commit45e8762c19e750bc25ab9a53d075de4d810d7736
tree954cff2bbd8708d88886a43e6aac3c3baa3a1003
parentcbc676b904539c5af09d39499843941bf688c4d3
Bug 3449: shm_open failed (part 4: fixing memory_cache_shared defaults)

Properly initialize memory_cache_shared when not explicitly configured and
do not allocate shared memory segments if memory_cache_shared is off.

Prior to this change, shared memory was requested (during rrClaimMemoryNeeds)
before memory_cache_shared was initialized (during rrAfterConfig, unless
explicitly set in squid.conf). Moreover, MemStore::EntryLimit() calculation
ignored memory_cache_shared setting. All that resulted in an attempt to create
shared memory segments where none were needed or possible.

We now have a new Runners Registry (rrFinalizeConfig) that is dedicated to
finalizing complex configuration options, before those configurations options
are used to initialize modules, features, and services. As far as shared
memory is concerned, the initialization order is now:

  * rrFinalizeConfig: finalize memory_cache_shared if needed
  * rrClaimMemoryNeeds: request shared memory pages for the caches
  * rrAfterConfig: create shared memory segments

The same bug 3449 also needed a fix for shared segment paths (trunk r11961).
src/MemStore.cc
src/base/RunnersRegistry.h
src/main.cc