File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2104,6 +2104,10 @@ def on_up(self, host):
21042104 with host .lock :
21052105 host .set_up ()
21062106 host ._currently_handling_node_up = False
2107+ for listener in self .listeners :
2108+ listener .on_up (host )
2109+ for session in tuple (self .sessions ):
2110+ session .update_created_pools ()
21072111
21082112 # for testing purposes
21092113 return futures
Original file line number Diff line number Diff line change @@ -410,6 +410,22 @@ def test_update_host_endpoint_notifies_listeners_for_live_host(self):
410410 session .remove_pool .assert_called_once_with (host )
411411 session .add_or_renew_pool .assert_called_once_with (host , is_host_addition = False )
412412
413+ def test_on_up_without_pool_futures_notifies_listeners (self ):
414+ cluster = Cluster (load_balancing_policy = RoundRobinPolicy (), protocol_version = 4 )
415+ self .addCleanup (cluster .shutdown )
416+
417+ host = Host (DefaultEndPoint ("127.0.0.1" ), SimpleConvictionPolicy , host_id = uuid .uuid4 ())
418+ host .set_down ()
419+ cluster .metadata .add_or_return_host (host )
420+
421+ listener = _RecordingHostStateListener ()
422+ cluster .register_listener (listener )
423+
424+ cluster .on_up (host )
425+
426+ assert host .is_up is True
427+ assert listener .events == [("up" , "127.0.0.1" )]
428+
413429 def test_update_host_endpoint_restarts_reconnector_when_replacement_pool_fails (self ):
414430 cluster = Cluster (load_balancing_policy = RoundRobinPolicy (), protocol_version = 4 )
415431 self .addCleanup (cluster .shutdown )
You can’t perform that action at this time.
0 commit comments