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
feat(box): tag container logs stdout vs stderr (split virtio-console)
container.json hard-coded stream="stdout" for every line — a container's
stderr (`echo x 1>&2`) was mislabeled stdout, the last Docker json-file
divergence. (The pipe-capture approach to separate streams was adversarially
rejected — it can freeze the container / hang shutdown.)
Use libkrun's 3-fd virtio-console instead: guest stdout -> console.log, stderr
-> console.err.log (krun_add_virtio_console_default, after
krun_disable_implicit_console). EMPIRICALLY verified libkrun separates the
streams with NO guest change and no pipe (console devices aren't bounded pipes
the container can block on, so no freeze/deadlock).
- shim: split console by default (BOX_NO_SPLIT_STDERR forces legacy merged;
falls back to merged if the err file can't be opened).
- core/log.rs: the processor tails BOTH files on scoped threads sharing one
RotatingWriter, tagging each line's stream; filters libkrun's `init.krun:`
preamble on BOTH streams (it can land on either).
- cli: foreground `run` and `attach` tail console.err.log to the terminal's
stderr (stdout->fd1, stderr->fd2, like Docker); `logs` routes stderr lines to
its stderr.
KVM-verified: `echo OUT; echo ERR 1>&2` -> container.json tags OUT=stdout,
ERR=stderr, zero init.krun noise; foreground shows stdout on fd1 + stderr on
fd2; detached logs still complete; exit code 5 propagates. Completes Docker
json-file log parity.
0 commit comments