PDGGK opened a new pull request, #18238:
URL: https://github.com/apache/iotdb/pull/18238

   ## Description
   
   `AbstractDataTool.readCsvFile` returns a `CSVParser` that owns the 
underlying `FileInputStream`, but the CLI import call sites (`ImportData`, 
`ImportDataTree`, `ImportDataTable`, `ImportSchemaTree`) never closed it. The 
empty-file / invalid-header early returns leaked the file descriptor 
immediately, and importing a directory of many CSV files could exhaust the 
process limit with `Too many open files`.
   
   This wraps the parser in a try-with-resources at each call site so it (and 
the `FileInputStream` it wraps) is closed on every exit path. The record 
`Stream` is fully consumed inside the block before the method returns, so 
closing on scope exit is safe. A test is added asserting the parser is closed 
after use.
   
   This closes #18237.
   


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

Reply via email to