From 1f145c0f6e8f82aff9cacb5c04db3e5f11bb73cc Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Thu, 18 May 2023 20:10:52 -0700 Subject: [PATCH] Do not fail when cleaning up loop file handlers --- salt/utils/asynchronous.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/utils/asynchronous.py b/salt/utils/asynchronous.py index e887cb693f0..0b7ac540a92 100644 --- a/salt/utils/asynchronous.py +++ b/salt/utils/asynchronous.py @@ -108,7 +108,10 @@ class SyncWrapper: log.exception("Exception encountered while running stop method") io_loop = self.io_loop io_loop.stop() - io_loop.close(all_fds=True) + try: + io_loop.close(all_fds=True) + except KeyError: + pass def __getattr__(self, key): if key in self._async_methods: