Example #1
0
    def clearExecutor(self, procId):
        LOG("Clearing executor for " + repr(procId))

        executor = self.getExecutor(procId)

        if executor is None:
            raise ContextError("No such executor: " + repr(procId))
        # Remove executor from client infos
        clients = executor.getClients()
        for client in clients:
            self.getClient(client).delExecutor(procId)

        self.__execLock.acquire()
        try:
            # Remove executor manager
            del self.__executorManagers[procId]
            # Remove the corresponding instance from the list
            idx = procId.find("#")
            id = procId[0:idx]
            instance = int(procId[idx + 1:])
            # Remove from the registry
            self.__executorsRegistry.removeProcess(procId)
            if id in self.__executorInstanceNumbers:
                self.__executorInstanceNumbers[id].remove(instance)
                if len(self.__executorInstanceNumbers[id]) == 0:
                    self.__executorInstanceNumbers.pop(id)
        finally:
            self.__execLock.release()
        return
Example #2
0
 def clearExecutor(self, procId):
     LOG("Clearing executor for " + repr(procId))
     
     executor = self.getExecutor(procId)
     
     if executor is None:
         raise ContextError("No such executor: " + repr(procId))
     # Remove executor from client infos
     clients = executor.getClients()
     for client in clients:
         self.getClient(client).delExecutor(procId)
         
     self.__execLock.acquire()
     try:
         # Remove executor manager
         del self.__executorManagers[procId]
         # Remove the corresponding instance from the list
         idx = procId.find("#")
         id = procId[0:idx]
         instance = int(procId[idx+1:])
         # Remove from the registry
         self.__executorsRegistry.removeProcess(procId)
         if id in self.__executorInstanceNumbers:
             self.__executorInstanceNumbers[id].remove(instance)
             if len(self.__executorInstanceNumbers[id])==0:
                 self.__executorInstanceNumbers.pop(id)
     finally:
         self.__execLock.release()
     return
Example #3
0
 def executorError(self, procId, msg):
     errorText = "Executor fatal error"  
     errorMsg = MsgHelper.createError2(CtxMessages.MSG_EXEC_ERROR, procId, "CLT", errorText, msg)
     errorMsg[CtxMessages.FIELD_PROC_ID] = procId
     
     executor = self.getExecutor(procId)
     if executor:
         procClients = executor.getClients()
         self.messageToClients(procId, procClients, errorMsg)
     else:
         LOG("No executor found to notify error", LOG_ERROR)