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): """