From af12352cba4a4ecd3859addbe21ff7169546fc9c Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 21 Nov 2023 14:34:46 -0700 Subject: [PATCH] Close pub channel returned by eval_master coroutine --- salt/minion.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/salt/minion.py b/salt/minion.py index 08204be815b..29afda23504 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -953,7 +953,18 @@ class SMinion(MinionBase): "use_master_when_local", False ): io_loop = salt.ext.tornado.ioloop.IOLoop.current() - io_loop.run_sync(lambda: self.eval_master(self.opts, failed=True)) + + @salt.ext.tornado.gen.coroutine + def eval_master(): + """ + Wrap eval master in order to close the returned publish channel. + """ + master, pub_channel = yield self.eval_master(self.opts, failed=True) + pub_channel.close() + + io_loop.run_sync( + lambda: eval_master() # pylint: disable=unnecessary-lambda + ) self.gen_modules(initial_load=True, context=context) # If configured, cache pillar data on the minion