Browse Source

Merge "Use gearman client keepalive"

changes/05/633605/1
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
91e7e680a1
8 changed files with 25 additions and 9 deletions
  1. +1
    -1
      requirements.txt
  2. +3
    -1
      zuul/driver/github/githubconnection.py
  3. +3
    -1
      zuul/executor/client.py
  4. +6
    -2
      zuul/executor/server.py
  5. +3
    -1
      zuul/merger/client.py
  6. +3
    -1
      zuul/merger/server.py
  7. +3
    -1
      zuul/rpcclient.py
  8. +3
    -1
      zuul/rpclistener.py

+ 1
- 1
requirements.txt View File

@ -8,7 +8,7 @@ python-daemon>=2.0.4,<2.1.0
extras
statsd>=3.0
voluptuous>=0.10.2
gear>=0.9.0,<1.0.0
gear>=0.13.0,<1.0.0
apscheduler>=3.0
PrettyTable>=0.6,<0.8
babel>=1.0


+ 3
- 1
zuul/driver/github/githubconnection.py View File

@ -152,7 +152,9 @@ class GithubGearmanWorker(object):
ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
self.gearman = gear.TextWorker('Zuul Github Connector')
self.log.debug("Connect to gearman")
self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca)
self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
keepalive=True, tcp_keepidle=60,
tcp_keepintvl=30, tcp_keepcnt=5)
self.log.debug("Waiting for server")
self.gearman.waitForServer()
self.log.debug("Registering")


+ 3
- 1
zuul/executor/client.py View File

@ -122,7 +122,9 @@ class ExecutorClient(object):
ssl_cert = get_default(self.config, 'gearman', 'ssl_cert')
ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
self.gearman = ZuulGearmanClient(self)
self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca)
self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
keepalive=True, tcp_keepidle=60,
tcp_keepintvl=30, tcp_keepcnt=5)
self.cleanup_thread = GearmanCleanup(self)
self.cleanup_thread.start()


+ 6
- 2
zuul/executor/server.py View File

@ -2239,10 +2239,14 @@ class ExecutorServer(object):
ssl_cert = get_default(self.config, 'gearman', 'ssl_cert')
ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
self.merger_worker = ExecutorMergeWorker(self, 'Zuul Executor Merger')
self.merger_worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca)
self.merger_worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
keepalive=True, tcp_keepidle=60,
tcp_keepintvl=30, tcp_keepcnt=5)
self.executor_worker = ExecutorExecuteWorker(
self, 'Zuul Executor Server')
self.executor_worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca)
self.executor_worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
keepalive=True, tcp_keepidle=60,
tcp_keepintvl=30, tcp_keepcnt=5)
self.log.debug("Waiting for server")
self.merger_worker.waitForServer()
self.executor_worker.waitForServer()


+ 3
- 1
zuul/merger/client.py View File

@ -82,7 +82,9 @@ class MergeClient(object):
ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
self.log.debug("Connecting to gearman at %s:%s" % (server, port))
self.gearman = MergeGearmanClient(self)
self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca)
self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
keepalive=True, tcp_keepidle=60,
tcp_keepintvl=30, tcp_keepcnt=5)
self.log.debug("Waiting for gearman")
self.gearman.waitForServer()
self.jobs = set()


+ 3
- 1
zuul/merger/server.py View File

@ -60,7 +60,9 @@ class MergeServer(object):
ssl_cert = get_default(self.config, 'gearman', 'ssl_cert')
ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
self.worker = gear.TextWorker('Zuul Merger')
self.worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca)
self.worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
keepalive=True, tcp_keepidle=60,
tcp_keepintvl=30, tcp_keepcnt=5)
self.log.debug("Waiting for server")
self.worker.waitForServer()
self.log.debug("Registering")


+ 3
- 1
zuul/rpcclient.py View File

@ -29,7 +29,9 @@ class RPCClient(object):
def __init__(self, server, port, ssl_key=None, ssl_cert=None, ssl_ca=None):
self.log.debug("Connecting to gearman at %s:%s" % (server, port))
self.gearman = gear.Client()
self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca)
self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
keepalive=True, tcp_keepidle=60,
tcp_keepintvl=30, tcp_keepcnt=5)
self.log.debug("Waiting for gearman")
self.gearman.waitForServer()


+ 3
- 1
zuul/rpclistener.py View File

@ -48,7 +48,9 @@ class RPCListener(object):
ssl_cert = get_default(self.config, 'gearman', 'ssl_cert')
ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
self.worker = gear.TextWorker('Zuul RPC Listener')
self.worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca)
self.worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
keepalive=True, tcp_keepidle=60,
tcp_keepintvl=30, tcp_keepcnt=5)
self.log.debug("Waiting for server")
self.worker.waitForServer()
self.log.debug("Registering")


Loading…
Cancel
Save