From ccde43037493295e3e51c94a065bd9cc28c26bb9 Mon Sep 17 00:00:00 2001 From: Ahmed hossam Date: Thu, 29 Jan 2026 20:10:44 +0200 Subject: [PATCH] fix: race condition in SpillPool caused by buffered stream Signed-off-by: Ahmed hossam --- datafusion/physical-plan/src/spill/spill_manager.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datafusion/physical-plan/src/spill/spill_manager.rs b/datafusion/physical-plan/src/spill/spill_manager.rs index 89b0276206774..9b2f32dcec8d3 100644 --- a/datafusion/physical-plan/src/spill/spill_manager.rs +++ b/datafusion/physical-plan/src/spill/spill_manager.rs @@ -28,7 +28,7 @@ use std::sync::Arc; use super::{SpillReaderStream, in_progress_spill_file::InProgressSpillFile}; use crate::coop::cooperative; -use crate::{common::spawn_buffered, metrics::SpillMetrics}; +use crate::metrics::SpillMetrics; /// The `SpillManager` is responsible for the following tasks: /// - Reading and writing `RecordBatch`es to raw files based on the provided configurations. @@ -186,7 +186,7 @@ impl SpillManager { max_record_batch_memory, ))); - Ok(spawn_buffered(stream, self.batch_read_buffer_capacity)) + Ok(stream) } }