Repository navigation
fix(bulk): accept ndjson lines longer than 5MB - #216
Merged
Merged
Conversation
bufio.Scanner capped lines at 5MB, so a single large record failed the whole bulk request with "token too long". Read lines with bufio.Reader instead. Ported from the archived fix/bulk-index-token-scanner branch (27adfee), without its xsd: datatype change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #216 +/- ##
==========================================
+ Coverage 36.01% 36.08% +0.07%
==========================================
Files 412 412
Lines 38115 38113 -2
==========================================
+ Hits 13726 13754 +28
+ Misses 24387 24357 -30
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The bulk parser read ndjson with a
bufio.Scannercapped at 5MB per line. One record over that size failed the whole request withbufio.Scanner: token too long. This switches tobufio.Reader.ReadBytes('\n'), which has no line limit. Behaviour is otherwise unchanged: invalid JSON lines are still counted and skipped.Ported from the 2024 gerrit-era branch
fix/bulk-index-token-scanner(27adfee, now atarchive/local/fix/bulk-index-token-scanner). Itsxsd:datatype change inikuzo/rdf/literal.gowas left out on purpose: it validatedxsd:decimalwithout expanding the IRI, so it would emit<xsd:decimal>in N-Triples.Test:
TestParseLongLinesends a 6MB line. It fails on main with "token too long" and passes here.Also fixes
JSONErrors, which was incremented twice per invalid line. The test asserts it is now counted once.🤖 Generated with Claude Code