File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -450,6 +450,12 @@ pub struct CleanupLocksResult {
450450 // TODO: pub resolved_locks: usize,
451451}
452452
453+ impl CleanupLocksResult {
454+ fn has_error ( & self ) -> bool {
455+ self . key_error . is_some ( ) || self . region_error . is_some ( )
456+ }
457+ }
458+
453459impl Clone for CleanupLocksResult {
454460 fn clone ( & self ) -> Self {
455461 Self {
@@ -478,8 +484,14 @@ impl Merge<CleanupLocksResult> for Collect {
478484 input
479485 . into_iter ( )
480486 . fold ( Ok ( CleanupLocksResult :: default ( ) ) , |acc, x| {
487+ let new_ret = x?;
488+ let new_lock_cnt = if new_ret. has_error ( ) {
489+ 0
490+ } else {
491+ new_ret. meet_locks
492+ } ;
481493 Ok ( CleanupLocksResult {
482- meet_locks : acc?. meet_locks + x? . meet_locks ,
494+ meet_locks : acc?. meet_locks + new_lock_cnt ,
483495 ..Default :: default ( )
484496 } )
485497 } )
You can’t perform that action at this time.
0 commit comments