diff --git a/sdk/src/client/builder.rs b/sdk/src/client/builder.rs index 85a9d73678..01a70d101c 100644 --- a/sdk/src/client/builder.rs +++ b/sdk/src/client/builder.rs @@ -195,7 +195,7 @@ impl ClientBuilder { let node_sync_interval = self.node_manager_builder.node_sync_interval; let ignore_node_health = self.node_manager_builder.ignore_node_health; - let nodes = self + let nodes: HashSet = self .node_manager_builder .primary_nodes .iter() @@ -207,7 +207,9 @@ impl ClientBuilder { let (mqtt_event_tx, mqtt_event_rx) = tokio::sync::watch::channel(MqttEvent::Connected); let client_inner = Arc::new(ClientInner { - node_manager: RwLock::new(self.node_manager_builder.build(HashSet::new())), + // Initially assume all nodes are healthy, so `fetch_network_info()` works. `sync_nodes()` will afterwards + // update the healthy nodes. + node_manager: RwLock::new(self.node_manager_builder.build(nodes.clone())), api_timeout: RwLock::new(self.api_timeout), #[cfg(feature = "mqtt")] mqtt: super::MqttInner {