Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Closing the reader after default pre-buffered reads leaves cached mapped buffers that can block file deletion on Windows, requiring cache release during close and a regression test that deletes the file before reader destruction.
1 open issue
What changed in this PR
This PR addresses GH-55695’s intermittent Windows file-deletion failures by making GLib Parquet readers explicitly close files they open, rather than relying on garbage collection.
Changes:
- Track and close reader-owned sources while leaving caller-supplied streams open.
- Add close-behavior tests and explicit reader cleanup.
- Remove forced garbage collection from Ruby boolean-statistics tests.
| File | Description |
|---|---|
ruby/red-parquet/test/test-boolean-statistics.rb |
Remove statistics clearing and forced garbage collection. |
c_glib/test/parquet/test-arrow-file-reader.rb |
Centralize reader cleanup and test source ownership on close. |
c_glib/parquet-glib/arrow-file-reader.cpp |
Track owned sources, close them explicitly, and document ownership behavior. |
Review effort: Balanced
…file_reader_close() gparquet_arrow_file_reader_new_path() and gparquet_arrow_file_reader_new_path_full() open the given path as a memory mapped file. But gparquet_arrow_file_reader_close() doesn't close it because parquet::ParquetFileReader::Close() doesn't close its source. So the file is kept open until the reader is GC-ed. We can't remove the file on Windows while it's open. This is why TestBooleanStatistics in Red Parquet fails randomly on Windows: it depends on GC.start freeing the reader. gparquet_arrow_file_reader_close() closes the file opened by the reader now. The source passed to gparquet_arrow_file_reader_new_arrow() and gparquet_arrow_file_reader_new_arrow_full() isn't closed because it's owned by the caller. Tests don't depend on GC to remove temporary files now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kou
force-pushed
the
gh-55695-parquet-glib-close
branch
from
November 22, 2026 13:28
83603a5 to
00c95ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Rationale for this change
gparquet_arrow_file_reader_new_path()andgparquet_arrow_file_reader_new_path_full()open the given path as a memory mapped file. Butgparquet_arrow_file_reader_close()doesn't close it becauseparquet::ParquetFileReader::Close()doesn't close its source. So the file is kept open until the reader is GC-ed. We can't remove the file on Windows while it's open. This is whyTestBooleanStatisticsin Red Parquet fails randomly on Windows: it depends onGC.startfreeing the reader.What changes are included in this PR?
gparquet_arrow_file_reader_close()closes the file opened by the reader now. The source passed togparquet_arrow_file_reader_new_arrow()andgparquet_arrow_file_reader_new_arrow_full()isn't closed because it's owned by the caller.Are these changes tested?
Yes.
Are there any user-facing changes?
Yes.
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: