From dda083b9fb0d8fac536190966a4ffbe5c2cc5b93 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 9 Jan 2014 07:04:37 +0800 Subject: [PATCH] Move gear import to a safe place Importing gear now imports statsd which initializes a socket before the fork for geard. Move the gear import to avoid that until a better solution is worked out. Change-Id: I7c1d9911a3b9de072b4784c4af9543baf1aefc27 --- zuul/cmd/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zuul/cmd/server.py b/zuul/cmd/server.py index 3a51b1c44d..c2a9dab0a9 100755 --- a/zuul/cmd/server.py +++ b/zuul/cmd/server.py @@ -30,11 +30,10 @@ import sys import signal import traceback -import gear - # No zuul imports here because they pull in paramiko which must not be # imported until after the daemonization. # https://github.com/paramiko/paramiko/issues/59 +# Similar situation with gear and statsd. def stack_dump_handler(signum, frame): @@ -149,6 +148,7 @@ class Server(object): if child_pid == 0: os.close(pipe_write) self.setup_logging('gearman_server', 'log_config') + import gear gear.Server(4730) # Keep running until the parent dies: pipe_read = os.fdopen(pipe_read)