mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #29628 from DSRCompany/bug/26364_freebsd_tcp
Don't create io_loop before fork
This commit is contained in:
commit
a56c763423
1 changed files with 6 additions and 2 deletions
|
@ -629,10 +629,10 @@ class PubServer(tornado.tcpserver.TCPServer, object):
|
|||
|
||||
|
||||
class TCPPubServerChannel(salt.transport.server.PubServerChannel):
|
||||
def __init__(self, opts, io_loop=None):
|
||||
def __init__(self, opts):
|
||||
self.opts = opts
|
||||
self.serial = salt.payload.Serial(self.opts) # TODO: in init?
|
||||
self.io_loop = io_loop or tornado.ioloop.IOLoop.current()
|
||||
self.io_loop = None
|
||||
|
||||
def _publish_daemon(self):
|
||||
'''
|
||||
|
@ -640,6 +640,10 @@ class TCPPubServerChannel(salt.transport.server.PubServerChannel):
|
|||
'''
|
||||
salt.utils.appendproctitle(self.__class__.__name__)
|
||||
|
||||
# Check if io_loop was set outside
|
||||
if self.io_loop is None:
|
||||
self.io_loop = tornado.ioloop.IOLoop.current()
|
||||
|
||||
# Spin up the publisher
|
||||
pub_server = PubServer(io_loop=self.io_loop)
|
||||
pub_server.listen(int(self.opts['publish_port']), address=self.opts['interface'])
|
||||
|
|
Loading…
Add table
Reference in a new issue