-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
🚨 CRITICAL SAFETY VIOLATION
Location: message_handler.rs:80-81
Problem
let mut receiver = self.message_receiver.lock().await;
// ... infinite loop while holding lockIssues
- Holding a mutex across an infinite
loop - Any async operation while locked will deadlock
- No timeout mechanism
Suggested Fix
// Use timeout for lock acquisition
let mut receiver = match tokio::time::timeout(
Duration::from_millis(100),
self.message_receiver.lock()
).await {
Ok(lock) => lock,
Err(_) => {
warn!("Failed to acquire lock within timeout");
continue;
}
};Priority: Critical - Deadlocks can freeze the entire system and require restart.