BUG: Concurrent duplicate write streams targeting server.log #32
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Both server/index.js and server/utils/logger.js open separate fs.createWriteStream references on the identical server.log file path. This leads to concurrent, uncoordinated I/O stream writes within the same process, causing message scrambling, duplicate file descriptors, and locking race conditions.
Resolution: Simplified server/utils/logger.js to delegate logToFile directly to console.log. Because server/index.js overrides console.log to print to stdout and write to the central server.log write stream, this removes the duplicate uncoordinated write stream, preventing locking race conditions and log scrambling.