Open p-ouellette opened 1 year ago
I think this sounds like expected behaviour.
When using -T
(which forces non-interactive mode) or in a non-interactive environment (like Jenkins CI) LXD will write output of stdout and stderr from the remote process to the associated channels on the local host where lxc
is being run. If you are piping that output into a pipe that isn't being consumed then it will eventually fill up the buffer and stop.
This is so slow consumers don't miss output.
If you are piping that output into a pipe that isn't being consumed then it will eventually fill up the buffer and stop.
But I don't think I am piping the output? This command hangs and I'm not piping it's output:
lxc exec -T ub22test2 -- bash -c 'while true; do date >&2; sleep 1; done'
The pipe that gets filled is a pipe used by LXD.
Required information
Details
Issue description
The following command hangs after executing for 46 minutes and 19 seconds.
It only hangs when I run the command from a Jenkins job. The date command is blocked writing to stdout, which is connected to a pipe:
If I drain the pipe, the bash process resumes.
Also, there is no hang if I remove the stderr redirection or use ssh instead of lxc exec as in the following commands:
I'm not certain this is an LXD bug, but I can only reproduce it with lxc exec. The bash command does not hang when run outside of a container in Jenkins.
EDIT: it seems to be reproducible outside of Jenkins if I force non-interactive mode:
The pipe eventually fills up and blocks the process.
Information to attach
dmesg
)lxc info NAME --show-log
)lxc config show NAME --expanded
)lxc monitor
while reproducing the issue)