activator: log tee closes the app's stdout when the agent's stdout write fails Issue open
Found by Astra while reviewing gvisor-empty-execstart (f0ec79c9; review at ~/.cache/gvisor-execstart-review/astra.md on docs-t1). Pre-existing, not introduced by that branch, so not fixed there.
internal/activator/loglistener.go, logListener.tee: the tee is io.Copy(sink, c), where sink is io.MultiWriter(os.Stdout, the app-log line writer). When the write to the agent's own stdout (journald) fails, io.Copy returns, the deferred c.Close() runs, and the guest's or unit's log connection is closed under it. The guest's next write to stdout or stderr then gets EPIPE and, for a process that does not ignore SIGPIPE, dies of it. That is the same failure shape the branch fixed (a Rastrillo app killed on its first log line), reached by a different cause: the agent's stdout going away (journald restart or a full pipe) rather than a refused connection.
Second, related: a write to the agent's stdout that blocks (journald not draining) blocks the tee, and Close cannot unblock it, because closing the input socket does not interrupt an output write. Close waits on the wait group, so it can stall for as long as the stdout write does.
Possible directions (not decided): keep draining the connection when the stdout leg fails (drop journald lines, keep the app-log sink and the guest alive), for example a writer that swallows stdout errors after the first; and bound or decouple the stdout write so Close cannot hang on it.
Applies to every unit-family log listener (systemd and gVisor), not only gVisor.