'Intended for internal use only.'

@run_in_executor
def on_down(self, host, is_host_addition, expect_host_to_be_down=False):

    if self.is_shutdown:
        return
    with host.lock:
        was_up = host.is_up
        if (self._discount_down_events and (self.profile_manager.distance(host) != HostDistance.IGNORED)):
            connected = False
            for session in self.sessions:
                pool_states = session.get_pool_state()
                pool_state = pool_states.get(host)
                if pool_state:
                    connected |= (pool_state['open_count'] > 0)
            if connected:
                return
        host.set_down()
        if (((not was_up) and (not expect_host_to_be_down)) or host.is_currently_reconnecting()):
            return
    log.warning('Host    %s    has    been    marked    down', host)
    self.profile_manager.on_down(host)
    self.control_connection.on_down(host)
    for session in self.sessions:
        session.on_down(host)
    for listener in self.listeners:
        listener.on_down(host)
    self._start_reconnector(host, is_host_addition)
