From: Amos Jeffries Date: Fri, 4 Sep 2015 19:54:07 +0000 (-0700) Subject: Quieten UFS cache maintenance skipped warnings X-Git-Tag: SQUID_4_0_1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d842c91cf8e15ddaff8c6642fe17c47a61a6be84;p=thirdparty%2Fsquid.git Quieten UFS cache maintenance skipped warnings The maintenance loop cycles once per second. On long DIRTY cache rebuilds this can reult in a lot of log mesages at level 1. * reduce the messages to L=3 except once per minute allow one at L=1 * perform the under-size limit check first to allow completely silent skipping when no maintenance would have taken place anyway. --- diff --git a/src/fs/ufs/UFSSwapDir.cc b/src/fs/ufs/UFSSwapDir.cc index b2123f68ba..371e7fdfd2 100644 --- a/src/fs/ufs/UFSSwapDir.cc +++ b/src/fs/ufs/UFSSwapDir.cc @@ -440,18 +440,25 @@ Fs::Ufs::UFSSwapDir::maintain() * of low-, high- water and the total capacity limit. */ - /* We can't delete objects while rebuilding swap */ - /* XXX FIXME each store should start maintaining as it comes online. */ - if (StoreController::store_dirs_rebuilding) { - debugs(47, DBG_IMPORTANT, StoreController::store_dirs_rebuilding << " cache_dir still rebuilding. Skip GC for " << path); - return; - } - // minSize() is swap_low_watermark in bytes const uint64_t lowWaterSz = minSize(); if (currentSize() < lowWaterSz) { - debugs(47, 2, "space still available in " << path); + debugs(47, 5, "space still available in " << path); + return; + } + + /* We can't delete objects while rebuilding swap */ + /* XXX each store should start maintaining as it comes online. */ + if (StoreController::store_dirs_rebuilding) { + // suppress the warnings, except once each minute + static int64_t lastWarn = 0; + int warnLevel = 3; + if (lastWarn+60 < squid_curtime) { + lastWarn = squid_curtime; + warnLevel = DBG_IMPORTANT; + } + debugs(47, warnLevel, StoreController::store_dirs_rebuilding << " cache_dir still rebuilding. Skip GC for " << path); return; }