def children(self): """emits a generator of our child process objects this is only really useful for scab detection this only works if the child pid has been contained in another AppProcess Instance. Of course it could also be useful in bizarre situations with apps that have a parent supervisor and child worker. """ for process in AppProcess.objects: if IKittNullProcess.providedBy(process.process): continue if not self.pid: break if process == self: continue if process.server.hostname != self.server.hostname: continue if process.ppid == self.pid and AppProcess.isValid(process): yield process
def children(self): """emits a generator of our child process objects this is only really useful for scab detection this only works if the child pid has been contained in another AppProcess Instance. Of course it could also be useful in bizarre situations with apps that have a parent supervisor and child worker. """ for process in AppProcess.objects: if IKittNullProcess.providedBy(process.process): continue if not self.pid: break if process == self: continue if process.server.hostname != self.server.hostname: continue if process.ppid == self.pid and AppProcess.isValid(process): yield process
def __init__(self, server, pid): self._pid = pid self.server = IDroneModelServer(server) self._created = time.time() #don't set self._process try: try: #re-constructing, can cause problems with this if IKittNullProcess.providedBy(self.process.process): raise InvalidProcess("Invalid PID (%s)" % pid) except AttributeError: if isinstance(self.process, NullProcess): raise InvalidProcess("Invalid PID (%s)" % pid) raise #re-raise do avoid ending up in a pickle, literally except InvalidProcess: AppProcess.delete(self) #make sure we are invalid raise InvalidProcess("Invalid PID (%s)" % pid) except IOError: #linux and solaris kitt.proc.LiveProcess use files AppProcess.delete(self) #make sure we are invalid raise InvalidProcess("Invalid PID (%s)" % pid) except: err('wtf happened here .. seriously i do not know!!!') AppProcess.delete(self) #make sure we are invalid raise
def __init__(self, server, pid): self._pid = pid self.server = IDroneModelServer(server) self._created = time.time() #don't set self._process try: try: #re-constructing, can cause problems with this if IKittNullProcess.providedBy(self.process.process): raise InvalidProcess("Invalid PID (%s)" % pid) except AttributeError: if isinstance(self.process, NullProcess): raise InvalidProcess("Invalid PID (%s)" % pid) raise #re-raise do avoid ending up in a pickle, literally except InvalidProcess: if config.HOSTNAME == self.server.hostname: AppProcess.delete(self) #make sure we are invalid raise InvalidProcess("Invalid PID (%s)" % pid) except IOError: #linux and solaris kitt.proc.LiveProcess use files AppProcess.delete(self) #make sure we are invalid raise InvalidProcess("Invalid PID (%s)" % pid) except: err('wtf happened here .. seriously i do not know!!!') AppProcess.delete(self) #make sure we are invalid raise