Example #1
0
    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
Example #2
0
    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 
Example #3
0
 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()
Example #4
0
 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()
Example #5
0
    def killExecutor(self, procId):
        LOG("Killing executor for " + repr(procId))

        executor = self.getExecutor(procId)

        if executor is None:
            raise ContextError("No such executor: " + repr(procId))

        executor.stop(True)

        self.notifyExecutorOperation(procId, CtxMessages.DATA_EXOP_KILL)
        return True
Example #6
0
 def killExecutor(self, procId):
     LOG("Killing executor for " + repr(procId))
     
     executor = self.getExecutor(procId)
     
     if executor is None:
         raise ContextError("No such executor: " + repr(procId))
     
     executor.stop(True)
     
     self.notifyExecutorOperation(procId, CtxMessages.DATA_EXOP_KILL)
     return True