jayzhan211 commented on code in PR #27602:
URL: https://github.com/apache/datafusion/pull/27602#discussion_r4649634884


##########
datafusion/execution/src/disk_manager.rs:
##########
@@ -369,21 +369,31 @@ impl DiskManager {
         self.active_files_count.fetch_add(1, Ordering::Relaxed);
         Ok(Arc::new(RefCountedTempFile {
             parent_temp_dir: Arc::clone(&local_dirs[dir_index]),
+            // Keep only the path. A held `NamedTempFile` keeps one file
+            // descriptor open per spill file, so an operator that holds many
+            // spill runs (for example a hash aggregate before its final merge)
+            // can exhaust the process file limit. Writers and readers open the
+            // path on demand instead.

Review Comment:
   Optional cleanup: the struct doc on `RefCountedTempFile` already says why it 
holds no fd, and this comment mostly describes what changed. It can go.
   
   ```suggestion
   ```
   



-- 
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]

Reply via email to