summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2018-07-25 15:35:26 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2018-07-25 15:35:26 +0200
commit899379539977efcc6d05836214ff4b426f223665 (patch)
tree7c4e54895a9b02bf62e100b4e1d4c17a4a268b3f
parent9c7cdbcabd8997504d6a3b876e91ea34ddb7c266 (diff)
downloadpykolab-899379539977efcc6d05836214ff4b426f223665.tar.gz
Revert "Let a single worker process timeout itself"
This reverts commit 9c7cdbcabd8997504d6a3b876e91ea34ddb7c266.
-rw-r--r--wallace/__init__.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/wallace/__init__.py b/wallace/__init__.py
index f3450dc..1e050ef 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -23,10 +23,8 @@ import grp
import multiprocessing
import os
import pwd
-import random
import traceback
from smtpd import SMTPChannel
-import signal
import socket
import struct
import sys
@@ -99,18 +97,7 @@ def modules_heartbeat(wallace_modules):
break
def worker_process(*args, **kw):
- seed = random.randint(0, 6)
- alarm_after = (seed * 10) + 60
-
- signal.alarm(alarm_after)
-
- log.debug(
- _("Worker process %s initializing (lasts <= %d seconds)") % (
- multiprocessing.current_process().name,
- alarm_after
- ),
- level=1
- )
+ log.debug(_("Worker process %s initializing") % (multiprocessing.current_process().name), level=1)
class WallaceDaemon(object):
def __init__(self):
@@ -493,13 +480,10 @@ class WallaceDaemon(object):
sys.exit(exitcode)
def set_signal_handlers(self):
+ import signal
signal.signal(signal.SIGHUP, self.reload_config)
- signal.signal(signal.SIGINT, self.terminate)
signal.signal(signal.SIGTERM, self.remove_pid)
- def terminate(self, *args, **kw):
- sys.exit(0)
-
def write_pid(self):
pid = os.getpid()
if os.access(os.path.dirname(conf.pidfile), os.W_OK):