def killProcRollback(cls, taskObj, pid, ctime): """ First part of several volume rollbacks. """ cls.log.info("pid=%s ctime=%s", pid, ctime) try: pidCtime = misc.getProcCtime(pid) except OSError, e: cls.log.debug("pid=%s ctime=%s (%s)", pid, ctime, str(e)) return
def killProcRollback(cls, taskObj, pid, ctime): """ First part of several volume rollbacks. """ cls.log.info("pid=%s ctime=%s", pid, ctime) try: pidCtime = misc.getProcCtime(pid) except OSError as e: cls.log.debug("pid=%s ctime=%s (%s)", pid, ctime, str(e)) return try: # If process exists and it's a same process kill it # We identifying the process according its pid and ctime if ctime == pidCtime: os.kill(int(pid), signal.SIGKILL) except Exception: cls.log.error("pid=%s ctime=%s", pid, ctime, exc_info=True) raise
def baseAsyncTasksRollback(proc): name = "Kill-" + str(proc.pid) vars.task.pushRecovery( task.Recovery(name, "volume", "Volume", "killProcRollback", [str(proc.pid), str(misc.getProcCtime(proc.pid))]))
def baseAsyncTasksRollback(proc): name = "Kill-" + str(proc.pid) vars.task.pushRecovery(task.Recovery(name, "volume", "Volume", "killProcRollback", [str(proc.pid), str(misc.getProcCtime(proc.pid))]))