Skip to content

Commit aa6ca8d

Browse files
fsdvhavantgardnerio
authored andcommitted
Ignore writer shutdown error (#271)
* ignore writer shutdown error * cargo check
1 parent 330f105 commit aa6ca8d

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
@@ -212,9 +212,12 @@ pub(crate) async fn stateless_serialize_and_write_files(
212212

213213
// Finalize or abort writers as appropriate
214214
for mut writer in finished_writers.into_iter() {
215-
writer.shutdown()
216-
.await
217-
.map_err(|_| internal_datafusion_err!("Error encountered while finalizing writes! Partial results may have been written to ObjectStore!"))?;
215+
if let Err(e) = writer.shutdown().await {
216+
// ignore if writer already closed
217+
if e.kind() != std::io::ErrorKind::InvalidInput {
218+
return Err(internal_datafusion_err!("Error encountered while finalizing writes! Partial results may have been written to ObjectStore! Error: {e}"));
219+
}
220+
}
218221
}
219222

220223
if any_errors {

0 commit comments

Comments
 (0)