@@ -4,7 +4,7 @@ use std::cmp::Ordering;
4
4
use std:: collections:: HashMap ;
5
5
use std:: collections:: HashSet ;
6
6
use std:: future:: Future ;
7
- use std:: sync:: { Arc , Mutex } ;
7
+ use std:: sync:: Arc ;
8
8
use std:: time:: { Duration , Instant , SystemTime } ;
9
9
10
10
use bytes:: Bytes ;
@@ -24,6 +24,7 @@ use chroma_types::chroma_proto::{ForkLogsRequest, ForkLogsResponse};
24
24
use chroma_types:: CollectionUuid ;
25
25
use figment:: providers:: { Env , Format , Yaml } ;
26
26
use opentelemetry:: metrics:: Meter ;
27
+ use parking_lot:: Mutex ;
27
28
use parquet:: arrow:: arrow_reader:: ParquetRecordBatchReaderBuilder ;
28
29
use prost:: Message ;
29
30
use serde:: { Deserialize , Serialize } ;
@@ -646,15 +647,13 @@ pub struct LogServer {
646
647
impl LogServer {
647
648
fn set_backpressure ( & self , to_pressure : & [ CollectionUuid ] ) {
648
649
let mut new_backpressure = Arc :: new ( HashSet :: from_iter ( to_pressure. iter ( ) . cloned ( ) ) ) ;
649
- // SAFETY(rescrv): Mutex poisoning.
650
- let mut backpressure = self . backpressure . lock ( ) . unwrap ( ) ;
650
+ let mut backpressure = self . backpressure . lock ( ) ;
651
651
std:: mem:: swap ( & mut * backpressure, & mut new_backpressure) ;
652
652
}
653
653
654
654
fn check_for_backpressure ( & self , collection_id : CollectionUuid ) -> Result < ( ) , Status > {
655
655
let backpressure = {
656
- // SAFETY(rescrv): Mutex poisoning.
657
- let backpressure = self . backpressure . lock ( ) . unwrap ( ) ;
656
+ let backpressure = self . backpressure . lock ( ) ;
658
657
Arc :: clone ( & backpressure)
659
658
} ;
660
659
if backpressure. contains ( & collection_id) {
0 commit comments