mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 03:29:23 +08:00
Two processes (the CLI launcher and the uvicorn server) can install a RotatingFileHandler for the same log file. On Windows the rename inside doRollover() fails with WinError 32 while the other process holds the file open, and the stock handler then raises on every subsequent emit: records are dropped and stderr floods with --- Logging error --- tracebacks. TolerantRotatingFileHandler reopens the current file after a failed rotation, writes a single warning to stderr, and retries the rotation on the next emit so it completes once the other process is gone. Fixes #2563