You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A somewhat easy way to reproduce this (a scenario where this happens frequently) is if the consoles are being spammed with log messages and you exit a remote sysop console using ^C. Perhaps the console file descriptors are going away while they are being logged to, but that doesn't entirely make sense either.
This causes a deadlock, but only at the thread level, i.e. not all logging is broken. Because threads get stuck with a RDLOCK held on the remote logger fd's, it becomes impossible to obtain a WRLOCK, which blocks sysop console registration/unregistration. Otherwise, other logging and other threads remain nominally unaffected.
The text was updated successfully, but these errors were encountered:
When a large amount of data is being logged,
libc_write will get stuck because the file
descriptors for remote console logging are
blocking. We now make them nonblocking
whenever we write to them, and this resolves
that issue.
Granted, we may lose some messages on remote
consoles by doing this, but if that's happening,
there's likely another bug triggering an
avalanche of log messages that needs investigating.
Other related improvements that improve dealing
with large amounts of I/O:
* bbs_write can fail to write all of the bytes.
We retry this in a loop (as we should), but
instead of a tight loop or an arbitrarily
less tight loop, use the POLLOUT event
to time the write optimally.
* If a pseudoterminal write operation returns -1,
shut down the PTY.
Fixes#13
Split off from #12, since this is a separate issue:
Logging can also get stuck here due to write blocking forever:
A somewhat easy way to reproduce this (a scenario where this happens frequently) is if the consoles are being spammed with log messages and you exit a remote sysop console using
^C
. Perhaps the console file descriptors are going away while they are being logged to, but that doesn't entirely make sense either.This causes a deadlock, but only at the thread level, i.e. not all logging is broken. Because threads get stuck with a
RDLOCK
held on the remote logger fd's, it becomes impossible to obtain aWRLOCK
, which blocks sysop console registration/unregistration. Otherwise, other logging and other threads remain nominally unaffected.The text was updated successfully, but these errors were encountered: