BUG: Concurrent duplicate write streams targeting server.log #32

Closed
opened 2026-05-22 15:40:10 +01:00 by Gandalf · 1 comment
Owner

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.

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.
Gandalf added the Kind/Bug label 2026-05-22 15:40:35 +01:00
Author
Owner

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.

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.
Gandalf added the Area/Logging label 2026-05-28 11:53:58 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/sofarr#32