]> git.ipfire.org Git - thirdparty/squid.git/commit
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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Thu, 11 Apr 2019 19:58:25 +0000 (07:58 +1200)
commitb610b9d1f05df4dac69146dfa2db2050e7ddc920
tree616e2ff7cb0eb94febf516a5e8cea86a800f485e
parentd8ed845f6c365a73d4d8778644c5dbb19ad6c7d4
Bug 4796: comm.cc !isOpen(conn->fd) assertion when rotating logs (#382)

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