cxzl25 opened a new pull request, #56589:
URL: https://github.com/apache/spark/pull/56589

   ### What changes were proposed in this pull request?
   1. `OrcPartitionReaderFactory.createORCReader`: wrap the body after 
`OrcFile.createReader` in a try/catch; on any exception, close the reader 
before re-throwing.
   2. `OrcPartitionReaderFactory.buildColumnarReader`: remove the `lazy` 
qualifier from `val (reader, readerOptions)`, which was meaningless because 
`reader` is accessed on the very next line.
   
   ### Why are the changes needed?
   Reader may not be closed properly when an exception is thrown.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Added `OrcPartitionReaderFactorySuite` with a test that reproduces the leak 
scenario.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   <!--
   If generative AI tooling has been used in the process of authoring this 
patch, please include the
   phrase: 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling 
Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   


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