mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #37899 from DSRCorporation/bugs/37059_schedule_task_hang
Clear functions context in schedule tasks for ZeroMQ.
This commit is contained in:
commit
c07ad11279
1 changed files with 4 additions and 1 deletions
|
@ -629,10 +629,13 @@ class Schedule(object):
|
|||
'''
|
||||
Execute this method in a multiprocess or thread
|
||||
'''
|
||||
if salt.utils.is_windows():
|
||||
if salt.utils.is_windows() or self.opts.get('transport') == 'zeromq':
|
||||
# Since function references can't be pickled and pickling
|
||||
# is required when spawning new processes on Windows, regenerate
|
||||
# the functions and returners.
|
||||
# This also needed for ZeroMQ transport to reset all functions
|
||||
# context data that could keep paretns connections. ZeroMQ will
|
||||
# hang on polling parents connections from the child process.
|
||||
self.functions = salt.loader.minion_mods(self.opts)
|
||||
self.returners = salt.loader.returners(self.opts, self.functions)
|
||||
ret = {'id': self.opts.get('id', 'master'),
|
||||
|
|
Loading…
Add table
Reference in a new issue