summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-28 20:09:30 +0000
committerGerrit Code Review <review@openstack.org>2019-01-28 20:09:30 +0000
commit91e7e680a16dc17469195029750a0a3231586c10 (patch)
tree2cd214f535bcb8ca1de1a203ea935c30bd273601
parentd1c4b3519a0c72a17fbdf41978702a7585941f2c (diff)
parentfb4c6402a46f8f96ba09f681bfd5356329d416a9 (diff)
Merge "Use gearman client keepalive"
-rw-r--r--requirements.txt2
-rw-r--r--zuul/driver/github/githubconnection.py4
-rw-r--r--zuul/executor/client.py4
-rw-r--r--zuul/executor/server.py8
-rw-r--r--zuul/merger/client.py4
-rw-r--r--zuul/merger/server.py4
-rw-r--r--zuul/rpcclient.py4
-rw-r--r--zuul/rpclistener.py4
8 files changed, 25 insertions, 9 deletions
diff --git a/requirements.txt b/requirements.txt
index 4e6611f..a7a7779 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -8,7 +8,7 @@ python-daemon>=2.0.4,<2.1.0
8extras 8extras
9statsd>=3.0 9statsd>=3.0
10voluptuous>=0.10.2 10voluptuous>=0.10.2
11gear>=0.9.0,<1.0.0 11gear>=0.13.0,<1.0.0
12apscheduler>=3.0 12apscheduler>=3.0
13PrettyTable>=0.6,<0.8 13PrettyTable>=0.6,<0.8
14babel>=1.0 14babel>=1.0
diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py
index d8fbb26..6cc4c2e 100644
--- a/zuul/driver/github/githubconnection.py
+++ b/zuul/driver/github/githubconnection.py
@@ -152,7 +152,9 @@ class GithubGearmanWorker(object):
152 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca') 152 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
153 self.gearman = gear.TextWorker('Zuul Github Connector') 153 self.gearman = gear.TextWorker('Zuul Github Connector')
154 self.log.debug("Connect to gearman") 154 self.log.debug("Connect to gearman")
155 self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca) 155 self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
156 keepalive=True, tcp_keepidle=60,
157 tcp_keepintvl=30, tcp_keepcnt=5)
156 self.log.debug("Waiting for server") 158 self.log.debug("Waiting for server")
157 self.gearman.waitForServer() 159 self.gearman.waitForServer()
158 self.log.debug("Registering") 160 self.log.debug("Registering")
diff --git a/zuul/executor/client.py b/zuul/executor/client.py
index 1f44422..00ea8eb 100644
--- a/zuul/executor/client.py
+++ b/zuul/executor/client.py
@@ -122,7 +122,9 @@ class ExecutorClient(object):
122 ssl_cert = get_default(self.config, 'gearman', 'ssl_cert') 122 ssl_cert = get_default(self.config, 'gearman', 'ssl_cert')
123 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca') 123 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
124 self.gearman = ZuulGearmanClient(self) 124 self.gearman = ZuulGearmanClient(self)
125 self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca) 125 self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
126 keepalive=True, tcp_keepidle=60,
127 tcp_keepintvl=30, tcp_keepcnt=5)
126 128
127 self.cleanup_thread = GearmanCleanup(self) 129 self.cleanup_thread = GearmanCleanup(self)
128 self.cleanup_thread.start() 130 self.cleanup_thread.start()
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index a3224af..688e6db 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -2239,10 +2239,14 @@ class ExecutorServer(object):
2239 ssl_cert = get_default(self.config, 'gearman', 'ssl_cert') 2239 ssl_cert = get_default(self.config, 'gearman', 'ssl_cert')
2240 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca') 2240 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
2241 self.merger_worker = ExecutorMergeWorker(self, 'Zuul Executor Merger') 2241 self.merger_worker = ExecutorMergeWorker(self, 'Zuul Executor Merger')
2242 self.merger_worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca) 2242 self.merger_worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
2243 keepalive=True, tcp_keepidle=60,
2244 tcp_keepintvl=30, tcp_keepcnt=5)
2243 self.executor_worker = ExecutorExecuteWorker( 2245 self.executor_worker = ExecutorExecuteWorker(
2244 self, 'Zuul Executor Server') 2246 self, 'Zuul Executor Server')
2245 self.executor_worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca) 2247 self.executor_worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
2248 keepalive=True, tcp_keepidle=60,
2249 tcp_keepintvl=30, tcp_keepcnt=5)
2246 self.log.debug("Waiting for server") 2250 self.log.debug("Waiting for server")
2247 self.merger_worker.waitForServer() 2251 self.merger_worker.waitForServer()
2248 self.executor_worker.waitForServer() 2252 self.executor_worker.waitForServer()
diff --git a/zuul/merger/client.py b/zuul/merger/client.py
index 51c4afd..d534489 100644
--- a/zuul/merger/client.py
+++ b/zuul/merger/client.py
@@ -82,7 +82,9 @@ class MergeClient(object):
82 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca') 82 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
83 self.log.debug("Connecting to gearman at %s:%s" % (server, port)) 83 self.log.debug("Connecting to gearman at %s:%s" % (server, port))
84 self.gearman = MergeGearmanClient(self) 84 self.gearman = MergeGearmanClient(self)
85 self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca) 85 self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
86 keepalive=True, tcp_keepidle=60,
87 tcp_keepintvl=30, tcp_keepcnt=5)
86 self.log.debug("Waiting for gearman") 88 self.log.debug("Waiting for gearman")
87 self.gearman.waitForServer() 89 self.gearman.waitForServer()
88 self.jobs = set() 90 self.jobs = set()
diff --git a/zuul/merger/server.py b/zuul/merger/server.py
index a2f2303..bdb3cc5 100644
--- a/zuul/merger/server.py
+++ b/zuul/merger/server.py
@@ -60,7 +60,9 @@ class MergeServer(object):
60 ssl_cert = get_default(self.config, 'gearman', 'ssl_cert') 60 ssl_cert = get_default(self.config, 'gearman', 'ssl_cert')
61 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca') 61 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
62 self.worker = gear.TextWorker('Zuul Merger') 62 self.worker = gear.TextWorker('Zuul Merger')
63 self.worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca) 63 self.worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
64 keepalive=True, tcp_keepidle=60,
65 tcp_keepintvl=30, tcp_keepcnt=5)
64 self.log.debug("Waiting for server") 66 self.log.debug("Waiting for server")
65 self.worker.waitForServer() 67 self.worker.waitForServer()
66 self.log.debug("Registering") 68 self.log.debug("Registering")
diff --git a/zuul/rpcclient.py b/zuul/rpcclient.py
index d4a7bc9..ef12b96 100644
--- a/zuul/rpcclient.py
+++ b/zuul/rpcclient.py
@@ -29,7 +29,9 @@ class RPCClient(object):
29 def __init__(self, server, port, ssl_key=None, ssl_cert=None, ssl_ca=None): 29 def __init__(self, server, port, ssl_key=None, ssl_cert=None, ssl_ca=None):
30 self.log.debug("Connecting to gearman at %s:%s" % (server, port)) 30 self.log.debug("Connecting to gearman at %s:%s" % (server, port))
31 self.gearman = gear.Client() 31 self.gearman = gear.Client()
32 self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca) 32 self.gearman.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
33 keepalive=True, tcp_keepidle=60,
34 tcp_keepintvl=30, tcp_keepcnt=5)
33 self.log.debug("Waiting for gearman") 35 self.log.debug("Waiting for gearman")
34 self.gearman.waitForServer() 36 self.gearman.waitForServer()
35 37
diff --git a/zuul/rpclistener.py b/zuul/rpclistener.py
index 384b9c7..0fad72f 100644
--- a/zuul/rpclistener.py
+++ b/zuul/rpclistener.py
@@ -48,7 +48,9 @@ class RPCListener(object):
48 ssl_cert = get_default(self.config, 'gearman', 'ssl_cert') 48 ssl_cert = get_default(self.config, 'gearman', 'ssl_cert')
49 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca') 49 ssl_ca = get_default(self.config, 'gearman', 'ssl_ca')
50 self.worker = gear.TextWorker('Zuul RPC Listener') 50 self.worker = gear.TextWorker('Zuul RPC Listener')
51 self.worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca) 51 self.worker.addServer(server, port, ssl_key, ssl_cert, ssl_ca,
52 keepalive=True, tcp_keepidle=60,
53 tcp_keepintvl=30, tcp_keepcnt=5)
52 self.log.debug("Waiting for server") 54 self.log.debug("Waiting for server")
53 self.worker.waitForServer() 55 self.worker.waitForServer()
54 self.log.debug("Registering") 56 self.log.debug("Registering")