« Previous | Next » 

Revision 9c233417

ID9c233417e0bcf2837a619d7b21b42ed093dc8552
Parent 30989e69
Child 631eb662

Added by Iustin Pop almost 15 years ago

Make utils.RunCmd() deal with interleaved stdout/stderr

Currently, RunCmd is written with the assumption that programs will have
a small stderr output, therefore we read the child's stdout (which can
be big, so we don't want to block the child) and then the stderr (which
is small, so it shouldn't block).

However, with the ‘gnt-cluster verify-disks’ command, we ourselves
generate heavy stderr, therefore we break the ganeti-watcher which runs
the verify-disks via utils.RunCmd.

This patch turns the RunCmd command into an poll-based one, which means
any kind of interleaved output by a child on stdout/stderr will be
handled correctly. Of course, since the output is buffered in memory,
there are other ways to break RunCmd(). But at least this should fix the
common case.

Reviewed-by: hansmi

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences