浏览代码

Hack around process state machine invariant breakage.

Chris McDonough 18 年之前
父节点
当前提交
9aa5ab3458
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/supervisor/process.py

+ 6 - 0
src/supervisor/process.py

@@ -357,6 +357,12 @@ class Subprocess:
             self.backoff = 0
             self.exitstatus = es
             msg = "exited: %s (%s)" % (processname, msg + "; expected")
+            if self.state == ProcessStates.STARTING:
+                # XXX I dont know under which circumstances this happens,
+                # but in the wild, there is a transition that subverts
+                # the RUNNING state (directly from STARTING to EXITED),
+                # so we perform the transition here.
+                self.change_state(ProcessStates.RUNNING)
             self._assertInState(ProcessStates.RUNNING)
             self.change_state(ProcessStates.EXITED)
         else: