jayzhan211 commented on code in PR #23522:
URL: https://github.com/apache/datafusion/pull/23522#discussion_r3578975791
##########
datafusion/physical-plan/src/spill/spill_pool.rs:
##########
@@ -259,31 +254,35 @@ impl Drop for SpillPoolWriter {
return;
}
- // Finalize the current file when the last writer is dropped
- if let Some(current_file) = shared.current_write_file.take() {
- // Release shared lock before locking file
+ // Finalize any spill files that were not finished yet
+
+ if !shared.current_write_files.is_empty() {
+ // Copy and clear `current_write_files` so we can release shared
lock before locking files
+ let files = shared.current_write_files.clone();
+ shared.current_write_files.clear();
Review Comment:
Do we really need to release shared lock before locking files
Does it make sense to take `file` out from `current_write_files`
consecutively then we could avoid `clone`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]