fix(core): avoid holding pool registry locks during db io

This commit is contained in:
Guoyu Su authored and GitHub committed 2026-09-03 01:53:42 +08:00
1 parent 616c0daf25
commit d6fc1fe52c
30 files changed
+1436 -1110

No files matched your search

+1
View File
@@ -60,6 +60,7 @@ impl MySqlPool {
/// generation. Pool options are not an identity: a reconnect creates a new
/// pool with identical options, and a late health probe for the old pool
/// must not be allowed to remove that replacement from routing.
#[cfg(test)]
pub(crate) fn is_same_pool(&self, other: &Self) -> bool {
std::sync::Arc::ptr_eq(&self.inner.metrics(), &other.inner.metrics())
}
+16
View File
@@ -305,6 +305,22 @@ pub enum RedisConnection {
Cluster(RedisClusterPool),
}
#[cfg(test)]
pub(crate) fn redis_connection_test_stub() -> RedisConnection {
RedisConnection::Cluster(RedisClusterPool {
connection: None,
seed_nodes: Vec::new(),
seed_routes: Vec::new(),
slot_ranges: Vec::new(),
node_routes: Vec::new(),
tls: false,
tls_insecure: false,
username: String::new(),
password: String::new(),
scan_sessions: Box::new(Mutex::new(RedisClusterScanSessions::default())),
})
}
pub struct RedisClusterPool {
pub connection: Option<Mutex<ClusterConnection>>,
pub seed_nodes: Vec<RedisNodeEndpoint>,