Repository navigation
fix: wait for rows split across packets, stop trapping when a stream fails - #12
Merged
datlechin merged 2 commits intoOct 2, 2026
Merged
Conversation
…ng when a stream fails A row whose last field ended in the next TNS packet was reported complete, because the skips for the LONG/LONG RAW trailer, the object version and flags, and the row header read what had arrived and returned without asking for more. The rest was then read as a message ID, the connection failed mid-stream, and delivering that failure called back into cancel(for:) while the stream was still attached, which hit the "cancel stream without active statement" precondition and ended the host process. - Every skip and read in the backend message decoders throws when its bytes have not arrived, so the decoder retries the message with the next packet (upstream lovetodream#123). - throwingSkipRawBytesChunked treats 0xFF as NULL and drops the 254-byte precheck that left a short chunked value waiting forever. - Reader moves in message decoders throw instead of trapping on a short buffer. - OracleRowStream marks itself consumed before it finishes the async sequence, the channel handler detaches the stream before delivering an error, and a cancel or row request after the statement ended is ignored (postgres-nio #351, #456, #566). - A message the decoder cannot read fails as messageDecodingFailure, not as a lost connection. - A NULL object decodes as NULL.
…e bind counts An OUT bind of type LONG or LONG RAW ends with its actual byte count, not the null indicator and return code a fetched LONG carries, so the trailer is read only for fetched rows. The bind count in an IO vector is computed without UInt32 overflow and rejected when the statement could not have bound that many.
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.
Why
TablePro #3241: browsing an Oracle table with SDO_GEOMETRY and BLOB columns ended the host process. When a TNS packet ended inside a row's last field (the LONG RAW trailer of a BLOB, or a NULL object's flags), the non-throwing skips read what had arrived and reported the row complete. The rest of the field was then read as a message ID, the connection failed mid-stream, and delivering that failure called back into
cancel(for:)while the stream was still attached, which hit thecancelStatementStreamprecondition. Anyclose()while rows were streaming hit the same trap.Change
messageDecodingFailure; a NULL object decodes as NULL; the LONG trailer is read on fetched rows only; an impossible IO-vector bind count is rejected.Verified
New unit tests fail on
tablepro-mainand pass here. On Oracle 21c XE and 23ai, including real MDSYS.SDO_GEOMETRY, the reporter's browse query returns all 1000 rows where it crashed before.Not in this PR
OracleConnectionTests.oobCheckWorksfails and hangs ontablepro-maintoo.