You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can see there is a discontinuous jump from 12:48 to 13:01, indicating that buffer flushed.
I looked at the code. There are some suspicious things:
def run_cmd_or_die(cmd):
print(f"Running command: {cmd}")
p = subprocess.Popen(
"/bin/bash",
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.STDOUT,
bufsize=1,
universal_newlines=True,
errors="backslashreplace",
)
p.stdin.write("set -e\n")
p.stdin.write(cmd)
p.stdin.write("\nexit $?\n")
p.stdin.close()
result = ""
while p.poll() is None:
line = p.stdout.readline()
if line:
print(line, end="")
result += line
# Read any remaining output
for line in p.stdout:
print(line, end="")
result += line
exit_code = p.returncode
if exit_code != 0:
raise RuntimeError(f"Command {cmd} failed with exit code {exit_code}")
return result
stderr is piped to stdout, which would potentially cause it to be block buffered. The prints are not to stderr, so they might also be block buffered. But also I like... I don't understand why you are doing any of this at all? Like, you're not even doing anything with the result of the second docker exec call, why bother with the log tailer nonsense?
Signed-off-by: Edward Z. Yang <[email protected]>
ghstack-source-id: 00eceb62f5cf9540193db3eb9a91c40f76a4bc24
ghstack-comment-id: 2302706756
Pull Request resolved: #5583
Signed-off-by: Edward Z. Yang <[email protected]>
ghstack-source-id: 71aacb1e2a2df6a5bf21d826d02dcae9626ba3b8
ghstack-comment-id: 2302706756
Pull Request resolved: #5583
Evidence:
Look at some logs:
You can see there is a discontinuous jump from 12:48 to 13:01, indicating that buffer flushed.
I looked at the code. There are some suspicious things:
stderr is piped to stdout, which would potentially cause it to be block buffered. The prints are not to stderr, so they might also be block buffered. But also I like... I don't understand why you are doing any of this at all? Like, you're not even doing anything with the result of the second docker exec call, why bother with the log tailer nonsense?
cc @huydhn @lucylq
The text was updated successfully, but these errors were encountered: