]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-10588...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 28 Jun 2024 09:09:38 +0000 (11:09 +0200)
committerGitHub <noreply@github.com>
Fri, 28 Jun 2024 09:09:38 +0000 (09:09 +0000)
commit2a68ed986e9d19dff5d09713a5a225879acba3cb
treef88eb0e36789d0ec38211cab8f2f2c6b2be77a59
parenta5048ad990bab80ecfba9a9d4557100fc19b37f4
[3.12] gh-105623 Fix performance degradation in logging RotatingFileHandler (GH-105887) (GH-121116)

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.

(cherry picked from commit e9b4ec614b66d11623b80471409c16a109f888d5)

Co-authored-by: Craig Robson <craig@zhatt.com>
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]