def closeAll(self): if len(self.getExecutors()) == 0: LOG("No executors to be closed") return for procId in self.getExecutors(): LOG("Close all: " + procId) executor = self.getExecutor(procId) if executor: executor.stop() executor.waitForClose()
def closeAll(self): if len(self.getExecutors())==0: LOG("No executors to be closed") return for procId in self.getExecutors(): LOG("Close all: " + procId) executor = self.getExecutor(procId) if executor: executor.stop() executor.waitForClose()
def closeExecutor(self, procId): LOG("Requested closing executor " + repr(procId)) executor = self.getExecutor(procId) if executor is None: raise ContextError("No such executor: " + repr(procId)) LOG("Closing executor") executor.stop() success = executor.waitForClose() LOG("Executor closed (" + repr(success) + ")") if not success: error, reason = executor.getError() self.notifyExecutorOperation(procId, CtxMessages.DATA_EXOP_CLOSE) self.killExecutor(procId) self.clearExecutor(procId) raise ContextError("Could not close executor", error + ":" + reason) else: LOG("Notifying executor close", level=LOG_PROC) self.notifyExecutorOperation(procId, CtxMessages.DATA_EXOP_CLOSE) self.clearExecutor(procId) LOG("Close finished") return
def closeExecutor(self, procId): LOG("Requested closing executor " + repr(procId)) executor = self.getExecutor(procId) if executor is None: raise ContextError("No such executor: " + repr(procId)) LOG("Closing executor") executor.stop() success = executor.waitForClose() LOG("Executor closed (" + repr(success) + ")") if not success: error,reason = executor.getError() self.notifyExecutorOperation(procId, CtxMessages.DATA_EXOP_CLOSE) self.killExecutor(procId) self.clearExecutor(procId) raise ContextError("Could not close executor",error + ":" + reason) else: LOG("Notifying executor close", level = LOG_PROC) self.notifyExecutorOperation(procId, CtxMessages.DATA_EXOP_CLOSE) self.clearExecutor(procId) LOG("Close finished") return