]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887)
authorCraig Robson <craig@zhatt.com>
Thu, 27 Jun 2024 16:44:40 +0000 (09:44 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2024 16:44:40 +0000 (16:44 +0000)
commite9b4ec614b66d11623b80471409c16a109f888d5
tree786322a7c82360c0ad7bf2adacaeefcf48b46525
parent0890ad7c024ccf29614849b6ffadcb92c0e91ce7
gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887)

The check for whether the log file is a real file is expensive on NFS
filesystems.  This commit reorders the rollover condition checking to
not do the file type check if the expected file size is less than the
rotation threshold.

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Lib/logging/handlers.py
Misc/NEWS.d/next/Library/2023-06-17-09-07-06.gh-issue-105623.5G06od.rst [new file with mode: 0644]