fix: close pipe readers before join() to prevent conformance test hang#260
Merged
Conversation
#259) assertMatchesParquetOracle streams the vortex-java CSV export and the parquet oracle through a PipedWriter/PipedReader pair on two virtual threads, compared line-by-line by the main thread. If assertFilesMatch stops reading early (oracle abort, line mismatch), nobody drains the pipe anymore — a producer still writing blocks forever once its 128KB buffer fills, and the unconditional join() right after hangs forever. Never surfaced before #257 because every prior repeated/list column consumer failed fast (VortexException thrown immediately). #257 is the first case where the Java side succeeds and outruns an early-exiting reader (confirmed via jstack: main thread parked on Thread.join() for 18+ minutes, ~4s CPU time). Close both readers before join() so a producer parked on a full buffer gets an IOException instead of blocking; the artificial "Pipe closed" error ranks below the real captured errors in the existing priority order, so behavior is unchanged on every other path.
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.
Summary
RaincloudConformanceIntegrationTest.assertMatchesParquetOraclecould hang forever when a producer thread (e.g.CsvExporter) outruns a comparator that stopped reading early (oracle abort, line mismatch). Confirmed viajstack: main thread parked onThread.join()for 18+ minutes, ~4s CPU time.PipedReaders before callingjoin()on the producer threads, so a producer blocked on a full pipe buffer gets anIOExceptioninstead of blocking forever. The artificial "Pipe closed" error ranks below the real captured errors in the existing priority order, so behavior is unchanged on every other path.Discovered while triaging #257 — that fix is the first case where the vortex-java CSV export actually succeeds on a repeated/list column and produces enough output to outrun an early-exiting reader (the oracle aborts near-instantly on
maxRepetitionLevel > 0columns).Test plan
./mvnw verify -pl integration -am -Dit.test=RaincloudConformanceIntegrationTest— passes in ~4s (previously hung)glove-6b-50dtookinexpected-status.csv; confirmed post-fix it now cleanly aborts withTestAbortedException: oracle cannot format repeated list column: vectorinstead of hanging🤖 Generated with Claude Code