Преглед на файлове

- when supervisord attempted to kill a process with SIGKILL after
the process was not killed within "stopwaitsecs" using a "normal"
kill signal, supervisord would crash with an improper
AssertionError. Thanks to Calvin Hendryx-Parker.

Chris McDonough преди 18 години
родител
ревизия
6ad22a7433
променени са 2 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. 5 0
      CHANGES.txt
  2. 4 1
      src/supervisor/process.py

+ 5 - 0
CHANGES.txt

@@ -6,6 +6,11 @@
   - Fixed a bug where process communication events would not have the
     proper payload if the payload data was very short.
 
+  - when supervisord attempted to kill a process with SIGKILL after
+    the process was not killed within "stopwaitsecs" using a "normal"
+    kill signal, supervisord would crash with an improper
+    AssertionError.  Thanks to Calvin Hendryx-Parker.
+
 3.0a1
 
   - Default config file comment documented 10 secs as default for

+ 4 - 1
src/supervisor/process.py

@@ -309,7 +309,10 @@ class Subprocess:
             # RUNNING -> STOPPING
             self.killing = 1
             self.delay = now + self.config.stopwaitsecs
-            self._assertInState(ProcessStates.RUNNING,ProcessStates.STARTING)
+            # we will already be in the STOPPING state if we're doing a
+            # SIGKILL as a result of overrunning stopwaitsecs
+            self._assertInState(ProcessStates.RUNNING,ProcessStates.STARTING,
+                                ProcessStates.STOPPING)
             self.change_state(ProcessStates.STOPPING)
             options.kill(self.pid, sig)
         except (AssertionError, NotImplementedError):