]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4796: comm.cc !isOpen(conn->fd) assertion when rotating logs (#382)
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 1 Apr 2019 16:58:36 +0000 (16:58 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 2 Apr 2019 06:14:59 +0000 (06:14 +0000)
Squid abandoned cache.log file descriptor maintenance, calling fd_open()
but then closing the descriptor without fd_close(). If the original file
descriptor value was reused for another purpose, Squid would either hit
the reported assertion or log a "Closing open FD" WARNING (depending on
the new purpose). The cache.log file descriptor is closed on log
rotation and reconfiguration events.

This short-term solution avoids assertions and WARNINGs but sacrifices
cache.log listing in fd_table and, hence, mgr:filedescriptors reports.

The correct long-term solution is to properly maintain descriptor meta
information across cache.log closures/openings, but doing so from inside
of debug.cc is technically difficult due to linking boundaries/problems.

src/main.cc

index d0fe9fc71b5f50a9be53c48ff30eafdd05f54783..69d36388269491126ab3ece1a3eb1ca6e21dadd6 100644 (file)
@@ -1151,7 +1151,9 @@ mainInitialize(void)
 
     _db_init(Debug::cache_log, Debug::debugOptions);
 
-    fd_open(fileno(debug_log), FD_LOG, Debug::cache_log);
+    // Do not register cache.log descriptor with Comm (for now).
+    // See https://bugs.squid-cache.org/show_bug.cgi?id=4796
+    // fd_open(fileno(debug_log), FD_LOG, Debug::cache_log);
 
     debugs(1, DBG_CRITICAL, "Starting Squid Cache version " << version_string << " for " << CONFIG_HOST_TYPE << "...");
     debugs(1, DBG_CRITICAL, "Service Name: " << service_name);