Register functions in the RPC listener before running
A gear worker should not grab jobs before it has registered its
functions. A race condition could prevent it from picking up
jobs assigned to it.
Change-Id: I34a4e94c030d54800d592edf89ae06bb0b2627fc
diff --git a/zuul/rpclistener.py b/zuul/rpclistener.py
index 83d119f..551dd03 100644
--- a/zuul/rpclistener.py
+++ b/zuul/rpclistener.py
@@ -40,11 +40,11 @@
port = 4730
self.worker = gear.Worker('Zuul RPC Listener')
self.worker.addServer(server, port)
+ self.worker.waitForServer()
+ self.register()
self.thread = threading.Thread(target=self.run)
self.thread.daemon = True
self.thread.start()
- self.worker.waitForServer()
- self.register()
def register(self):
self.worker.registerFunction("zuul:enqueue")