(self, host, is_host_addition)
| 1912 | return futures |
| 1913 | |
| 1914 | def _start_reconnector(self, host, is_host_addition): |
| 1915 | if self.profile_manager.distance(host) == HostDistance.IGNORED: |
| 1916 | return |
| 1917 | |
| 1918 | schedule = self.reconnection_policy.new_schedule() |
| 1919 | |
| 1920 | # in order to not hold references to this Cluster open and prevent |
| 1921 | # proper shutdown when the program ends, we'll just make a closure |
| 1922 | # of the current Cluster attributes to create new Connections with |
| 1923 | conn_factory = self._make_connection_factory(host) |
| 1924 | |
| 1925 | reconnector = _HostReconnectionHandler( |
| 1926 | host, conn_factory, is_host_addition, self.on_add, self.on_up, |
| 1927 | self.scheduler, schedule, host.get_and_set_reconnection_handler, |
| 1928 | new_handler=None) |
| 1929 | |
| 1930 | old_reconnector = host.get_and_set_reconnection_handler(reconnector) |
| 1931 | if old_reconnector: |
| 1932 | log.debug("Old host reconnector found for %s, cancelling", host) |
| 1933 | old_reconnector.cancel() |
| 1934 | |
| 1935 | log.debug("Starting reconnector for host %s", host) |
| 1936 | reconnector.start() |
| 1937 | |
| 1938 | @run_in_executor |
| 1939 | def on_down(self, host, is_host_addition, expect_host_to_be_down=False): |
no test coverage detected