riptide icon indicating copy to clipboard operation
riptide copied to clipboard

Debug logger doesn't play nice with non-blocking stderr

Open sagebind opened this issue 5 years ago • 0 comments

The built-in logger currently does not play nice with standard error. Since we make standard I/O handles non-blocking while the Riptide runtime is in control, the logger will rightfully get an EAGAIN or equivalent error from time to time when trying to write a log and the buffer is full. We should update the logger to either:

  • Retry failed calls with some sort of delay. Presumably stderr will become ready shortly when this happens, and a retry might be good enough.
  • Make the logger a separate asynchoronous task that uses async I/O to write logs, and have the log macros simply append to that task's current buffer.

The latter seems like the more correct solution, but might be trickier, since loggers are global resources.

sagebind avatar May 14 '20 21:05 sagebind