File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,7 @@ async fn move_files(
556
556
for file in new_file_list. iter ( ) {
557
557
// use same lock to combine the operations of check lock and add to removing list
558
558
let wal_lock = infra:: local_lock:: lock ( "wal" ) . await ?;
559
+ let lock_guard = wal_lock. lock ( ) . await ;
559
560
let can_delete = if wal:: lock_files_exists ( & file. key ) {
560
561
log:: warn!(
561
562
"[INGESTER:JOB:{thread_id}] the file is in use, set to pending delete list: {}" ,
@@ -577,7 +578,7 @@ async fn move_files(
577
578
db:: file_list:: local:: add_removing ( & file. key ) . await ?;
578
579
true
579
580
} ;
580
- drop ( wal_lock ) ;
581
+ drop ( lock_guard ) ;
581
582
582
583
if can_delete {
583
584
match remove_file ( wal_dir. join ( & file. key ) ) {
Original file line number Diff line number Diff line change @@ -558,6 +558,7 @@ async fn get_file_list_inner(
558
558
559
559
// use same lock to combine the operations of filter by pending delete and lock files
560
560
let wal_lock = infra:: local_lock:: lock ( "wal" ) . await ?;
561
+ let lock_guard = wal_lock. lock ( ) . await ;
561
562
562
563
// filter by pending delete
563
564
let files = crate :: service:: db:: file_list:: local:: filter_by_pending_delete ( files) . await ;
@@ -567,7 +568,7 @@ async fn get_file_list_inner(
567
568
568
569
// lock theses files
569
570
wal:: lock_files ( & files) ;
570
- drop ( wal_lock ) ;
571
+ drop ( lock_guard ) ;
571
572
572
573
let stream_params = Arc :: new ( StreamParams :: new (
573
574
& query. org_id ,
You can’t perform that action at this time.
0 commit comments