-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logger.c: Improve robustness of remote console logging.
* Eliminate the fixed-size array for keeping track of whether logging is enabled for remote consoles and store this in a bit directly on the struct that already exists for each console. It made sense to do this, given the struct already exist, and this eliminates the 1024 fd constraint. * Add mutex for remote consoles so they can be locked when writing log messages, for atomicity. This also reduces (eliminates?) resource contention; previously, if a lot of logging was in progress, certain writes would fail due to the console's fd being busy (with nonblocking writes). This virtually doesn't happen anymore. * If remote console writes fail completely or partially, retry them (to an extent), since waiting a fraction of a ms and retrying can make it work. In practice, because each console now has a mutex, these cases shouldn't really happen anymore either (I tested both with and without mutexes to compare). * Make localdebug command work for the foreground console. Previously, it only worked for remote consoles. * mod_sysop: Disable logging immediately when a remote console disconnects, to avoid log failure messages on foreground console.
- Loading branch information
1 parent
ce62d96
commit 8c78afc
Showing
3 changed files
with
110 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters