New GitHub issue #96159 from dgrisby:<br>

<hr>

<pre>
The fix to https://github.com/python/cpython/issues/89564 was to add two file checks to the shouldRollover() method of logging.TimedRotatingFileHandler and RotatingFileHandler (see https://github.com/python/cpython/commit/62a667784ba7b84611ebd50fa8a1a464cde32235 )

This means that every single log call now does two stat() calls to the log file, which is quite expensive. If the log file is stored on NFS, those stat() calls become _extremely_ expensive. In our application it caused a dramatic (and hard to diagnose) performance loss.

It would be better if shouldRollover() was reverted to its previous implementation, and the check for special files was moved into doRollover(). That would mean the cost of the additional checks was only incurred when there is a rollover to do.
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/96159">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>