Skip to content

Commit e14204d

Browse files
authored
feat(propdefs-v2): inline batch writes when any batch bucket is full (#30959)
1 parent 03bdabc commit e14204d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

rust/property-defs-rs/src/v2_batch_ingestion.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,27 @@ pub async fn process_batch_v2(
306306
}
307307
}
308308
}
309+
310+
// if any of the batches are full, execute them now
311+
if handles.is_empty() {
312+
continue;
313+
}
314+
let to_exec = handles;
315+
handles = vec![];
316+
for handle in to_exec {
317+
match handle.await {
318+
// metrics are statted in write_*_batch methods so we just log here
319+
Ok(result) => match result {
320+
Ok(_) => continue,
321+
Err(db_err) => {
322+
error!("Batch write exhausted retries: {:?}", db_err);
323+
}
324+
},
325+
Err(join_err) => {
326+
warn!("Batch query JoinError: {:?}", join_err);
327+
}
328+
}
329+
}
309330
}
310331

311332
// ensure partial batches are flushed to Postgres too

0 commit comments

Comments
 (0)