Explorar o código

Only show waiting to die messages every three seconds.

Chris McDonough %!s(int64=18) %!d(string=hai) anos
pai
achega
0398127737
Modificáronse 2 ficheiros con 14 adicións e 3 borrados
  1. 6 0
      CHANGES.txt
  2. 8 3
      src/supervisor/supervisord.py

+ 6 - 0
CHANGES.txt

@@ -7,6 +7,12 @@
     socket file, so the process could not be controlled (it and all of
     its subprocesses would need to be killed by hand).
 
+  - When a process was not killable with a "normal" signal at shutdown
+    time, too many "INFO: waiting for x to die" messages would be sent
+    to the log until we ended up killing the process with a SIGKILL.
+    Now a maximum of one every three seconds is sent up until SIGKILL
+    time.  Thanks to Ian Bicking.
+
 2.1b2
 
   - Added new tailProcessLog() command to the XML-RPC API that

+ 8 - 3
src/supervisor/supervisord.py

@@ -430,6 +430,7 @@ class Subprocess:
 class Supervisor:
     mood = 1 # 1: up, 0: restarting, -1: suicidal
     stopping = False # set after we detect that we are handling a stop request
+    lastdelayreport = 0
 
     def __init__(self, options):
         self.options = options
@@ -515,9 +516,13 @@ class Supervisor:
                 # everything), it's OK to stop or reload
                 delayprocs = self.get_delay_processes()
                 if delayprocs:
-                    names = [ p.config.name for p in delayprocs]
-                    namestr = ', '.join(names)
-                    self.options.logger.info('waiting for %s to die' % namestr)
+                    now = time.time()
+                    if now > (self.lastdelayreport + 3): # every 3 secs
+                        names = [ p.config.name for p in delayprocs]
+                        namestr = ', '.join(names)
+                        self.options.logger.info('waiting for %s to die' %
+                                                 namestr)
+                        self.lastdelayreport = now
                 else:
                     break