raft/states/voter.py
def on_leader_timeout(self):
        """This is called when the leader timeout is reached."""
        from .candidate import Candidate  # TODO: Fix circular import

        logger.info(
            f"{self._server.group}: {self._server._name}: Lost Leader: {self.leader}"
        )
        if (
            self._server._parent
            and self._server._parent._state.leader_name != self._server._human_name
        ):
            logger.debug(
                f"{self._server._name}: {self._server.group}:"
                + f"not a leader in parent: {self._server._parent._state.leader_name} {self._server._human_name}"
            )
            return

        self.timer.cancel()
        self.leader = None
        candidate = Candidate()
        candidate.set_server(self._server)
        self._server._state = candidate

        return candidate, None
This is called when the leader timeout is reached.
This is called when the leader timeout is reached.
This is called when the leader timeout is reached .
def on_leader_timeout(self):
        from .candidate import Candidate  
        logger.info(
            f"{self._server.group}: {self._server._name}: Lost Leader: {self.leader}"
        )
        if (
            self._server._parent
            and self._server._parent._state.leader_name != self._server._human_name
        ):
            logger.debug(
                f"{self._server._name}: {self._server.group}:"
                + f"not a leader in parent: {self._server._parent._state.leader_name} {self._server._human_name}"
            )
            return
        self.timer.cancel()
        self.leader = None
        candidate = Candidate()
        candidate.set_server(self._server)
        self._server._state = candidate
        return candidate, None
def on_leader_timeout ( self ) : from . candidate import Candidate logger . info ( f"{self._server.group}: {self._server._name}: Lost Leader: {self.leader}" ) if ( self . _server . _parent and self . _server . _parent . _state . leader_name != self . _server . _human_name ) : logger . debug ( f"{self._server._name}: {self._server.group}:" + f"not a leader in parent: {self._server._parent._state.leader_name} {self._server._human_name}" ) return self . timer . cancel ( ) self . leader = None candidate = Candidate ( ) candidate . set_server ( self . _server ) self . _server . _state = candidate return candidate , None
This is called when the leader timeout is reached.
This is called when the leader timeout is reached .
"""This is called when the leader timeout is reached.""" # TODO: Fix circular import
self