Skip to content

Commit 7a23ad6

Browse files
authored
Ignore writer shutdown error (#271)
* ignore writer shutdown error * cargo check
1 parent 21376e0 commit 7a23ad6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

datafusion/core/src/datasource/file_format/write/orchestration.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,12 @@ pub(crate) async fn stateless_serialize_and_write_files(
173173

174174
// Finalize or abort writers as appropriate
175175
for mut writer in finished_writers.into_iter() {
176-
writer.shutdown()
177-
.await
178-
.map_err(|_| internal_datafusion_err!("Error encountered while finalizing writes! Partial results may have been written to ObjectStore!"))?;
176+
if let Err(e) = writer.shutdown().await {
177+
// ignore if writer already closed
178+
if e.kind() != std::io::ErrorKind::InvalidInput {
179+
return Err(internal_datafusion_err!("Error encountered while finalizing writes! Partial results may have been written to ObjectStore! Error: {e}"));
180+
}
181+
}
179182
}
180183

181184
if any_errors {

0 commit comments

Comments
 (0)