def announce_node(self, node_name, engine, process_dispatcher, state=None): """Announce a node to each process dispatcher. @param node_name: the name of the node to advertise @param engine: the execution engine of the node @param process_dispatcher: the pd to announce to @param state: the state to advertise to the pd """ if not state: state = InstanceState.RUNNING pd_client = ProcessDispatcherClient(self.dashi, process_dispatcher) log.info("Announcing %s of engine %s is '%s' to %s" % (node_name, engine, state, process_dispatcher)) domain_id = domain_id_from_engine(engine) for i in range(1, ADVERTISE_RETRIES): try: pd_client.node_state(node_name, domain_id, state) break except timeout: wait_time = i * i # Exponentially increasing wait log.warning("PD '%s' not available yet. Waiting %ss" % (process_dispatcher, wait_time)) time.sleep(2**i)
def announce_node(self, node_name, engine, process_dispatcher, state=None): """Announce a node to each process dispatcher. @param node_name: the name of the node to advertise @param engine: the execution engine of the node @param process_dispatcher: the pd to announce to @param state: the state to advertise to the pd """ if not state: state = InstanceState.RUNNING pd_client = ProcessDispatcherClient(self.dashi, process_dispatcher) log.info("Announcing %s of engine %s is '%s' to %s" % (node_name, engine, state, process_dispatcher)) domain_id = domain_id_from_engine(engine) for i in range(1, ADVERTISE_RETRIES): try: pd_client.node_state(node_name, domain_id, state) break except timeout: wait_time = i * i # Exponentially increasing wait log.warning("PD '%s' not available yet. Waiting %ss" % (process_dispatcher, wait_time)) time.sleep(2 ** i)