Skip to content

Commit

Permalink
respect time budget in main GC loop
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Dec 2, 2023
1 parent 0f24fa4 commit e3d6267
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/re_arrow_store/src/store_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ impl DataStore {
..
} = self;

let now = std::time::Instant::now();
for (&row_id, (timepoint, entity_path_hash)) in &metadata_registry.registry {
if protected_rows.contains(&row_id) {
batch_is_protected = true;
Expand Down Expand Up @@ -290,7 +291,7 @@ impl DataStore {
diffs.push(dropped);
}

if num_bytes_to_drop <= 0.0 {
if now.elapsed() >= options.time_budget || num_bytes_to_drop <= 0.0 {
break;
}

Expand Down

0 comments on commit e3d6267

Please sign in to comment.