From 105b129b08fcda6d0942d3fb47c8df53ce0fd6a6 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 2 Jun 2020 21:39:22 +0200 Subject: [PATCH] Fix infinite loop Since we never remove thread from the list of thread, podman-compose up never return as long as 1 thread is alive. --- podman_compose.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/podman_compose.py b/podman_compose.py index 559bb56..f6245f1 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1151,12 +1151,13 @@ def compose_up(compose, args): thread.start() threads.append(thread) time.sleep(1) - while True: + while threads: for thread in threads: thread.join(timeout=1.0) - if thread.is_alive(): continue - if args.abort_on_container_exit: - exit(-1) + if not thread.is_alive(): + threads.remove(thread) + if args.abort_on_container_exit: + exit(-1) @cmd_run(podman_compose, 'down', 'tear down entire stack') def compose_down(compose, args):