Skip to content

Commit dac8f93

Browse files
Update crates/fluss/src/client/connection.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 351f6d9 commit dac8f93

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

crates/fluss/src/client/connection.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use crate::config::Config;
2323
use crate::rpc::RpcClient;
2424
use parking_lot::RwLock;
2525
use std::sync::Arc;
26-
use tokio::sync::OnceCell;
2726
use std::time::Duration;
27+
use tokio::sync::OnceCell;
2828

2929
use crate::error::{Error, FlussError, Result};
3030
use crate::metadata::TablePath;
@@ -79,11 +79,7 @@ impl FlussConnection {
7979
}
8080

8181
pub async fn get_admin(&self) -> Result<FlussAdmin> {
82-
// Lazily initialize and cache the FlussAdmin instance. The cached FlussAdmin
83-
// holds a reference to RpcClient, which manages connection reuse and re-acquisition
84-
// when a cached connection becomes poisoned. Subsequent calls clone cheaply —
85-
// all internal fields (ServerConnection, Arc<Metadata>, Arc<RpcClient>) are
86-
// Arc-backed so cloning is just a reference-count bump.
82+
// Lazily init and cache the FlussAdmin instance, like Java's lazy-init pattern.
8783
let admin = self
8884
.admin_client
8985
.get_or_try_init(|| FlussAdmin::new(self.network_connects.clone(), self.metadata.clone()))

0 commit comments

Comments
 (0)