fix(client): yield Flight batches and affected rows without waiting for next message (#8918)

* fix(client): avoid Flight metrics lookahead stalls

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* refactor(client): extract trailing Flight metrics task

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* test(client): synchronize trailing metrics and bound cancellation

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

---------

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
(cherry picked from commit abf1396c28)
Signed-off-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
discord9
2026-10-12 12:49:20 +00:00
committed by WenyXu
parent 288bf0402e
commit ff40f4c2af
5 changed files with 364 additions and 147 deletions
+6
View File
@@ -1400,6 +1400,12 @@ impl BatchingTask {
match res {
Ok(res) => {
let (affected_rows, _) = res.output.extract_rows_and_cost();
if matches!(&res.output.data, common_query::OutputData::AffectedRows(_)) {
res.metrics.wait_ready().await;
}
if let Some(error) = res.metrics.completion_error() {
warn!("Flow {flow_id} completed with terminal metrics error: {error}");
}
debug!(
"Flow {flow_id} executed, affected_rows: {affected_rows:?}, elapsed: {:?}, watermark: {:?}",
elapsed,