Expand description
Bounding the output which gets forwarded after the process exited.
Structsยง
- Drain ๐
- Bounds forwarding the output after the process exited.
- Lag ๐
- Logs an attach client which falls behind the output once until it
caught up again, like
LogErrors. A client which stays too slow skips messages again every time the channel filled up, which would log a warning for every one of its capacity of messages otherwise.
Enumsยง
- Logging ๐
- What
Drain::recv_loggingended with.
Constantsยง
- DRAIN_
MAX_ ๐LOG_ WAIT - Upper bound for the time the exit files and the attach drains wait for
the log drivers to take the output after the process exited, which does
not count as a pause of the output, see
SharedContainerAttach::loggingandDrain::recv_attach, and for the read loops to end once stopped and the log to sync, seeReapableChild::finish_output. A log driver which is slow, like a journal which takes only part of every chunk in time, or which hangs, like a log file on a stuck disk, must not keep the exit from being reported for minutes. - DRAIN_
MAX_ ๐MESSAGES - Upper bound for the messages forwarded per drain after the process exited.
The output written before the exit is at most what the channels, the
STDIO_CHANNEL_SIZEof the stdio ones or theOUTPUT_CHANNEL_SIZEof the attach broadcast, and the pipe buffers hold. With the default pipe-max-size of 1 MiB in 8 KiB reads, that is 128 messages per pipe, and small writes read one by one do not fill a pipe of that size either, so this is well above. It is a heuristic though, a process with CAP_SYS_RESOURCE can grow its pipes further. More output stems from a grandchild which keeps the pipe open and writing, which would otherwise keep the drain going forever. - DRAIN_
MAX_ ๐WAIT - Upper bound for the time a drain waits for output after the process
exited in total. A grandchild which keeps writing just often enough for
DRAIN_TIMEOUTwould keep it going for minutes otherwise. Only the waiting counts, not the forwarding, so a slow client still gets the output which was there already. - DRAIN_
TIMEOUT ๐ - Upper bound for waiting on the next output after the process exited. The
read loops may still be draining the pipes when the exit is observed, they
signal the end with
Message::Done. The timeout only kicks in if that never arrives, for example because a grandchild keeps the pipe open.