Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion rust/lance-encoding/src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,15 @@ impl StructuralBatchDecodeStream {
let emitted_batch_size_warning = slf.emitted_batch_size_warning.clone();
let task = async move {
let next_task = next_task?;
async move { next_task.into_batch(emitted_batch_size_warning) }.await
// Real decode work happens inside into_batch, which can block the current
// thread for a long time. By spawning it as a new task, we allow Tokio's
// worker threads to keep making progress.
tokio::spawn(async move { next_task.into_batch(emitted_batch_size_warning) })
.await
.map_err(|err| Error::Wrapped {
error: err.into(),
location: location!(),
})?
};
(task, num_rows)
});
Expand Down
Loading