arg3t opened a new pull request, #3707:
URL: https://github.com/apache/parquet-java/pull/3707
## Rationale for this change
Makes ParquetFileWriter#end() mark the writer aborted before flushing, so an
incomplete file is never committed on failure. Previously close() ran before
the catch block in withAbortOnFailure and withAbortOnFailure only caught
IOException, causing:
- a corrupt file at the final path on non-rename storage when serializing
indexes/bloom filters/footer throws any exception
- a RuntimeException (e.g. OOM) to be missed, leaving the writer un-aborted
and still flushing
Closes #3706
## What changes are included in this PR?**
- withAbortOnFailure catches Throwable (not just IOException) and marks the
writer aborted.
- end() runs close() in an outer finally, so abort happens before close()
and the flush is skipped on failure.
## Are these changes tested?
Yes — 2 new tests in TestParquetFileWriter inject an
IOException/RuntimeException during end() and assert the stream is never
flushed.
## Are there any user-facing changes?
No. Successful writes are unchanged; only the failure path is affected.
--
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]