Skip to content

Commit cc00596

Browse files
committed
fix: always flush reporter writer after graph execution
On main, finish_graph_execution always wrote the full summary and flushed. With the compact summary, single-task non-cache-hit produces no summary output, so the flush was skipped. This caused child process output written via Stdio::inherit() to not be committed to the output stream, making it invisible to callers reading the same fd.
1 parent 7d49f24 commit cc00596

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

crates/vite_task/src/session/reporter/labeled.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,14 @@ impl GraphExecutionReporter for LabeledGraphReporter {
186186
}
187187

188188
// Write the summary buffer asynchronously.
189-
if !summary_buf.is_empty() {
189+
// Always flush the writer — even when the summary is empty, a preceding
190+
// spawned process may have written to the same fd via Stdio::inherit()
191+
// and the data must be flushed before the caller reads the output.
192+
{
190193
let mut writer = self.writer.borrow_mut();
191-
let _ = writer.write_all(&summary_buf).await;
194+
if !summary_buf.is_empty() {
195+
let _ = writer.write_all(&summary_buf).await;
196+
}
192197
let _ = writer.flush().await;
193198
}
194199

0 commit comments

Comments
 (0)