containers/composer: terminate composer first

Composer may depend on dnf-json and the worker to shut down cleanly.
This commit is contained in:
Tom Gundersen 2022-03-16 01:23:43 +00:00 committed by Ondřej Budai
parent c3d66b5a33
commit 367444635a

View file

@ -330,15 +330,15 @@ class Cli(contextlib.AbstractContextManager):
proc_dnf_json.wait()
except KeyboardInterrupt:
if proc_composer:
proc_composer.terminate()
res = proc_composer.wait()
if proc_worker:
proc_worker.terminate()
proc_worker.wait()
if proc_dnf_json:
proc_dnf_json.terminate()
proc_dnf_json.wait()
if proc_composer:
proc_composer.terminate()
res = proc_composer.wait()
except:
if proc_worker:
proc_worker.kill()