MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / _on_up_future_completed

Method _on_up_future_completed

cassandra/cluster.py:1805–1840  ·  view source on GitHub ↗
(self, host, futures, results, lock, finished_future)

Source from the content-addressed store, hash-verified

1803 self._start_reconnector(host, is_host_addition=False)
1804
1805 def _on_up_future_completed(self, host, futures, results, lock, finished_future):
1806 with lock:
1807 futures.discard(finished_future)
1808
1809 try:
1810 results.append(finished_future.result())
1811 except Exception as exc:
1812 results.append(exc)
1813
1814 if futures:
1815 return
1816
1817 try:
1818 # all futures have completed at this point
1819 for exc in [f for f in results if isinstance(f, Exception)]:
1820 log.error("Unexpected failure while marking node %s up:", host, exc_info=exc)
1821 self._cleanup_failed_on_up_handling(host)
1822 return
1823
1824 if not all(results):
1825 log.debug("Connection pool could not be created, not marking node %s up", host)
1826 self._cleanup_failed_on_up_handling(host)
1827 return
1828
1829 log.info("Connection pools established for node %s", host)
1830 # mark the host as up and notify all listeners
1831 host.set_up()
1832 for listener in self.listeners:
1833 listener.on_up(host)
1834 finally:
1835 with host.lock:
1836 host._currently_handling_node_up = False
1837
1838 # see if there are any pools to add or remove now that the host is marked up
1839 for session in tuple(self.sessions):
1840 session.update_created_pools()
1841
1842 def on_up(self, host):
1843 """

Callers

nothing calls this directly

Calls 6

discardMethod · 0.80
resultMethod · 0.80
set_upMethod · 0.80
update_created_poolsMethod · 0.80
on_upMethod · 0.45

Tested by

no test coverage detected