[fix] kill untrackable sessions
destroied session should not be alive any longer.
@@ -312,8 +312,10 @@ impl SessionManager {
&config.query.cluster_id,
);
+ let session = {
let mut sessions = self.active_sessions.write();
- sessions.remove(session_id);
+ sessions.remove(session_id)
+ };
//also need remove mysql_conn_map
let mut mysql_conns_map = self.mysql_conn_map.write();
for (k, v) in mysql_conns_map.deref_mut().clone() {
@@ -321,6 +323,9 @@ impl SessionManager {
mysql_conns_map.remove(&k);
}
}
+ if session.is_some() {
+ session.unwrap().kill();
+ }
}
pub fn graceful_shutdown(
