From b146653485d838fb4ab214b3409d2c4f76f2b861 Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Thu, 13 Jun 2024 12:19:09 +0200 Subject: [PATCH] spawn a seperate thread for the runtime shutdown --- localstack-core/localstack/runtime/runtime.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/localstack-core/localstack/runtime/runtime.py b/localstack-core/localstack/runtime/runtime.py index aff1d03820b55..1f55f63fd791c 100644 --- a/localstack-core/localstack/runtime/runtime.py +++ b/localstack-core/localstack/runtime/runtime.py @@ -79,7 +79,8 @@ def exit(self, code: int = 0): :param code: the exit code to be set """ self.exit_code = code - self.shutdown() + # we don't know yet why, but shutdown does not work on the main thread + threading.Thread(target=self.shutdown, name="Runtime-Shutdown").start() def shutdown(self): """