@@ -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 ;
@@ -23,6 +23,7 @@ use chroma_types::chroma_proto::{
23
23
use chroma_types:: chroma_proto:: { ForkLogsRequest , ForkLogsResponse } ;
24
24
use chroma_types:: CollectionUuid ;
25
25
use figment:: providers:: { Env , Format , Yaml } ;
26
+ use parking_lot:: Mutex ;
26
27
use parquet:: arrow:: arrow_reader:: ParquetRecordBatchReaderBuilder ;
27
28
use prost:: Message ;
28
29
use serde:: { Deserialize , Serialize } ;
@@ -622,15 +623,13 @@ pub struct LogServer {
622
623
impl LogServer {
623
624
fn set_backpressure ( & self , to_pressure : & [ CollectionUuid ] ) {
624
625
let mut new_backpressure = Arc :: new ( HashSet :: from_iter ( to_pressure. iter ( ) . cloned ( ) ) ) ;
625
- // SAFETY(rescrv): Mutex poisoning.
626
- let mut backpressure = self . backpressure . lock ( ) . unwrap ( ) ;
626
+ let mut backpressure = self . backpressure . lock ( ) ;
627
627
std:: mem:: swap ( & mut * backpressure, & mut new_backpressure) ;
628
628
}
629
629
630
630
fn check_for_backpressure ( & self , collection_id : CollectionUuid ) -> Result < ( ) , Status > {
631
631
let backpressure = {
632
- // SAFETY(rescrv): Mutex poisoning.
633
- let backpressure = self . backpressure . lock ( ) . unwrap ( ) ;
632
+ let backpressure = self . backpressure . lock ( ) ;
634
633
Arc :: clone ( & backpressure)
635
634
} ;
636
635
if backpressure. contains ( & collection_id) {
0 commit comments