Ejemplo n.º 1
0
 def python_watchdog_func(self, python, timeout):
     self.event.wait(timeout)
     if python.returncode is None:
         logger.error("Subprocess timed out and will be killed")
         shell.kill_process_with_children(python.pid)
         self.python_process_has_been_killed = True
     pass
Ejemplo n.º 2
0
 def python_watchdog_func(self, python, timeout):
   self.event.wait(timeout)
   if python.returncode is None:
     logger.error("Subprocess timed out and will be killed")
     shell.kill_process_with_children(python.pid)
     self.python_process_has_been_killed = True
   pass
Ejemplo n.º 3
0
 def puppet_watchdog_func(self, puppet):
   self.event.wait(float(self.puppet_timeout))
   if puppet.returncode is None:
     logger.error("Task timed out, killing process with PID: " + str(puppet.pid))
     shell.kill_process_with_children(puppet.pid)
     self.last_puppet_has_been_killed = True
   pass
 def puppet_watchdog_func(self, puppet):
   self.event.wait(self.PUPPET_TIMEOUT_SECONDS)
   if puppet.returncode is None:
     logger.error("Task timed out, killing process with PID: " + str(puppet.pid))
     shell.kill_process_with_children(puppet.pid)
     self.last_puppet_has_been_killed = True
   pass
Ejemplo n.º 5
0
 def cancel_command(self, task_id, reason):
     with self.commands_in_progress_lock:
         if task_id in self.commands_in_progress.keys():
             pid = self.commands_in_progress.get(task_id)
             self.commands_in_progress[task_id] = reason
             logger.info("Canceling command with task_id - {tid}, " \
                         "reason - {reason} . Killing process {pid}"
             .format(tid = str(task_id), reason = reason, pid = pid))
             shell.kill_process_with_children(pid)
         else:
             logger.warn("Unable to find pid by taskId = %s" % task_id)
Ejemplo n.º 6
0
 def cancel_command(self, task_id, reason):
   with self.commands_in_progress_lock:
     if task_id in self.commands_in_progress.keys():
       pid = self.commands_in_progress.get(task_id)
       self.commands_in_progress[task_id] = reason
       logger.info("Canceling command with task_id - {tid}, " \
                   "reason - {reason} . Killing process {pid}"
       .format(tid = str(task_id), reason = reason, pid = pid))
       shell.kill_process_with_children(pid)
     else: 
       logger.warn("Unable to find pid by taskId = %s"%task_id)
Ejemplo n.º 7
0
 def watchdog_func(self, command):
   self.event.wait(self.TIMEOUT_SECONDS)
   if command.returncode is None:
     logger.error("Task timed out and will be killed")
     shell.kill_process_with_children(command.pid)
   pass
Ejemplo n.º 8
0
 def watchdog_func(self, command):
   self.event.wait(self.TIMEOUT_SECONDS)
   if command.returncode is None:
     logger.error("Task timed out and will be killed")
     shell.kill_process_with_children(command.pid)
   pass