Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the documentation to reflect changes in version 5.4.0, including the introduction of the maxTransactionOpenTime configuration option, new job status values, and updated behavior for failed mid-stream JSON responses and local exports. The review feedback focuses on improving documentation consistency and style, specifically suggesting the addition of a version badge for the new configuration option and recommending the use of plain text instead of inline VersionBadge components within running prose.
9f047ac to
9daa1c9
Compare
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-762 This preview will update automatically when you push new commits. |
A streamed JSON array that fails after its 200 head now omits the closing bracket and aborts the connection (harper#3664). Document that contract next to the NDJSON and SSE terminal records, the maxTransactionOpenTime limit that commonly triggers it on long reads, and export_local's new failure outcome. Dispatch-Task: docs-harper-3664 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lures LMDB keeps a fixed 30-second monitor and ignores the setting. Say so, note the option takes milliseconds rather than a duration string, say how CSV and MessagePack report a mid-stream failure, and list every job status. Dispatch-Task: docs-harper-3664 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A CSV stream does not forward its source error yet (harper#3658), so it does not abort. Dispatch-Task: docs-harper-3664 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in get_job Dispatch-Task: pr-maint-badb3af9cefd2ca3a3b418701a8045f1 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…stream guidance Dispatch-Task: pr-maint-badb3af9cefd2ca3a3b418701a8045f1 Co-Authored-By: Gemini <noreply@google.com>
9daa1c9 to
dbe8661
Compare
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-762 This preview will update automatically when you push new commits. |
Companion to Cut off a JSON response that fails mid-stream: how a streamed JSON response reports a failure after its
200, and thestorage.maxTransactionOpenTimelimit that commonly causes one.⊙ Problem
From v5.4.0, a JSON response that fails mid-stream is cut off instead of ending as a complete
200. Clients need to know a cut-off body is a failed read. The usual cause, a client pausing a large read paststorage.maxTransactionOpenTime, is not documented, and neither isReadSnapshotExpiredError.🤔 Is this the right scope?
Yes. Every claim was checked against core
mainand the core PR's diff. The setting turned out to be RocksDB-only (LMDB has a fixed 30 s), so the docs say so.💡 Solution
storage.maxTransactionOpenTimeentry in Storage Tuning, with advice for slow readers, plus its configuration index line.🔧 Changes
export_localwithformat: jsonnow ends its jobERRORand removes the partial file, in Jobs and Operations.reference/(learn/developers/full-text-search-product-catalog.mdx:185) and an inline version note onreference/configuration/options.md:334are left out of this PR.🤔 CSV is left out
A failed CSV stream currently hangs instead of aborting. That is a core bug (harper#3658), so the docs make no claim for CSV. The MessagePack note covers aborting without an error record.
🤔 Milliseconds only
Core reads
maxTransactionOpenTimeas a raw number; a duration string like30sbreaks the monitor. The entry says to use milliseconds. The core fix (parse it likemaxTransactionQueueTime) is reported for triage, not made here.✅ Verification
npm run build,format:checkandlintpass. New anchors (#when-a-streamed-response-fails,#storagemaxtransactionopentime,#limitend-or-limitstartend) resolve in the built HTML.ReadSnapshotExpiredErrorand the 422 abort (resources/DatabaseTransaction.ts), the monitor's one-to-two interval timing, LMDB's fixed 30 s (resources/LMDBTransaction.ts), the jobERRORpath (server/jobs/jobProcess.ts), and the NDJSON/SSE record shape (server/serverHelpers/contentTypes.ts).v5.4.0: nov5.4.0tag exists yet and the core PR targetsmainwith milestone v5.4.Depends-on: HarperFast/harper#3664
Refs HarperFast/harper#2392
Claude Opus 5.5 (dispatch dev agent)
🤖 Generated with Claude Code
Related PRs: #691 independent, #739 independent, #754 independent, #772 overlaps
Deferred findings
928eef2f738616e1minor reliability —reference/rest/content-types.md— CSV streamed-failure behavior undocumented; core toCsvStream drops the source error — NOT FILED855af50e91dbc6afminor reliability —reference/database/storage-tuning.md— Core reads maxTransactionOpenTime raw; a duration string spins a 1ms monitor and disables expiry — NOT FILEDf802001270de35e1nit documentation —reference_versioned_docs/version-v4/database/jobs.md— Job status list omits CREATED (v5) and ERROR (archived v4 copy) — NOT FILED17c9faa6deaf2092nit maintainability —reference/database/storage-tuning.md— Open documentation#772 edits the same page; merge-order conflict risk — NOT FILED54e0824c2f2c92e1nit documentation —reference/rest/server-sent-events.md— SSE guide omits named terminal-error handling — NOT FILED3f1609c476fffb13nit documentation —reference/database/jobs.md— S3 JSON export failure contract is undocumented — NOT FILED0e0b7c81e1eb85d9nit documentation —reference/operations-api/operations.md— Operations API omits S3 export failure behavior — NOT FILEDOrigin — the dispatch brief this PR was written from
Document cut-off JSON streams and maxTransactionOpenTime for long streaming reads
Document how Harper reports a streamed JSON response that fails after it has started, and the
storage.maxTransactionOpenTimelimit for long streaming reads. Code change: HarperFast/harper#3664 (fixes HarperFast/harper#2392), targeted at v5.4.What changed (from the PR, verify against its diff):
application/jsonstreams a JSON array. If the source fails after the200head is sent, Harper now writes an{"error": "<Name>: <message>"}element as a best-effort diagnostic, omits the closing], and aborts the connection (HTTP/1.1: no chunked terminator; HTTP/2: stream reset). Before, the array was closed and the response ended as a normal 200, so a partial result looked complete.res.json()rejecting) as a failed read.HTTP 200alone does not mean the stream completed.$harperStreamErrorrecord) and SSE (event: harper-error) are unchanged.replicationUnconfirmed: true/retryable: falsewhen they apply.export_localwithformat: jsonnow rejects when the query fails mid-export and removes the partial file it wrote.storage.maxTransactionOpenTime(default 30000 ms), the transaction monitor closes the stalled read; when the client resumes, the read fails withReadSnapshotExpiredError(status 503, but the head is already sent, so the response is cut off as above). Advice: read promptly, raise the limit, or page withlimit/offset.Where: the REST/HTTP reference (streaming responses / content negotiation), the
storage.maxTransactionOpenTimeconfiguration entry, and the export operations reference. NeithermaxTransactionOpenTimenorReadSnapshotExpiredErrorappears in the docs today. Mark the behavior with the v5.4 version badge used elsewhere. Keep it short; no customer names.Dispatch: task
docs-harper-3664· queued by task:harper-rest-stream-error-trailer · ran by claude/opus/high · worker kzyp-xps-1Review-Coverage: authored=gemini; ran=cursor-composer,codex; pending=cursor-grok; late=cursor-grok:pending; adjudicated=domain,domain(codex); blocked=claude(quota); declined=muse; rounds=7; full=2 @ dbe8661
Review-Attention: read ~3m (decisions: centralize-stream-contract, export-scope; raised: degraded review) @ dbe8661