]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
tests: ceph-disk: use communicate() instead of wait() for output
authorKefu Chai <kchai@redhat.com>
Fri, 14 Jul 2017 16:07:03 +0000 (00:07 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 15 Jul 2017 03:27:02 +0000 (11:27 +0800)
commit73c0740b0822becc77ae25e8d6410ca8a1530832
tree26cb9833d114a97a9ba9042586c828176b82e48f
parent0cc65197d6d474a3a19f1d5813d8ecd451220e35
tests: ceph-disk: use communicate() instead of wait() for output

to avoid possible deadlock. quote from doc of Popen.wait()

> This will deadlock when using stdout=PIPE and/or stderr=PIPE and the
child process generates enough output to a pipe such that it blocks
waiting for the OS pipe buffer to accept more data. Use communicate() to
avoid that.

and print out the stdout and stderr using LOG.warn() if the command
fails.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/workunits/ceph-disk/ceph-disk-test.py