def assignTask(node, task, job):
     logger.debug("Assigning task with id %d to node %s", task.id, node.host)
     connection = TCPConnection(hostname=node.host)
     response = connection.getAnswer(StartRenderQuestion(job, task))
     if response:
         logger.debug("Task %d was accepted on %s", task.id, node.host)
     else:
         logger.error("Task %d was declined on %s", task.id, node.host)
     return response
 def checkNodeStatus(idleNodes):
     logger.debug("Checking Node Status on Idle Nodes")
     onlineList = []
     for nodeOBJ in idleNodes:
         connection = TCPConnection(hostname=nodeOBJ.host)
         answer = connection.getAnswer(IsAliveQuestion())
         if not answer:
             logger.debug("%s could not be reached! Removing from Idle Nodes.", nodeOBJ.host)
         else:
             onlineList.append(nodeOBJ)
     return onlineList
Example #3
0
    def sendKillQuestion(self, newStatus):
        """Kill the current task running on the renderhost. Return True if successful,
        else False"""
        logger.debug('Kill task on %s', self.host)
        connection = TCPConnection(hostname=self.host)
        answer = connection.getAnswer(KillCurrentTaskQuestion(newStatus))
        if answer is None:
            logger.debug("%s appears to be offline or unresponsive. Treating as dead.", self.host)
        else:
            logger.debug("Child killed return code '%s' for node '%s'", answer, self.host)
            if answer < 0:
                logger.warning("%s tried to kill its job but failed for some reason.", self.host)

        return answer