]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: Fix trucated output of `mgr dump` 34215/head
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 27 Mar 2020 22:24:58 +0000 (23:24 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 27 Mar 2020 23:42:34 +0000 (00:42 +0100)
In case the process has terminated, we
have to make sure to read till EOF, otherwise
we might skip some bytes.

Fixes: https://tracker.ceph.com/issues/44642
Co-authored-by: Tim Serong <tserong@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/cephadm/cephadm

index 528ff94b9ff419114a5b78ee2340d377ef9b6af3..38a1daf44ddddcbf1541cc47fc4db35a0872861a 100755 (executable)
@@ -640,6 +640,12 @@ def call(command,  # type: List[str]
                     message = message_b.decode('utf-8')
                 if isinstance(message_b, str):
                     message = message_b
+                if stop and message:
+                    # process has terminated, but have more to read still, so not stopping yet
+                    # (os.read returns '' when it encounters EOF)
+                    stop = False
+                if not message:
+                    continue
                 if fd == process.stdout.fileno():
                     out += message
                     message = out_buffer + message