-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
If the system clock is set to an earlier time after a process is started but before it has entered the RUNNING state, supervisorctl start <process_name> can hang for a very long time waiting for the current system time to become greater than self.laststart + self.config.startsecs, depending on how far backward the system time has moved.
I have resolved the issue with the following modification to the transition() function in process.py:
def transition(self):
now = time.time()
state = self.state
logger = self.config.options.logger
# If system clock has moved backward, reset self.laststart to current system time
if now < self.laststart:
self.laststart = now;
...
This solution still ensures that the process has remained running for at least self.config.startsecs while only increasing the maximum wait time to 2 * self.config.startsecs if the system clock is detected to have moved backward.
As I'm not too familiar with this code, I'm not sure if this is the best solution, nor am I sure if any other functions may require a check of this nature as well, so I figured I would leave this suggestion here and let a Supervisor dev who is more familiar with the code base decide on the most appropriate solution.
Please let me know if I can be of further assistance.