Repository navigation
fix(api): an app runs one export at a time; an import line over 64 MiB is refused with 413 - #2220
Merged
Merged
Conversation
thesyncim
force-pushed
the
fix/ai-3484-one-app-cannot-hold-the-pool
branch
from
November 23, 2026 14:52
c9ad893 to
d7650d0
Compare
- An app runs one export at a time on a router, answered 409 otherwise, and a router runs at most four exports at once, answered 503 otherwise. - An export ends after an hour, or when one line has taken a minute to write. - An export reads each table through a cursor, 100 rows at a time, so one that ends partway reads at most the rest of its batch. - An import line over 64 MiB is answered 413. - A name that no agent config, router config or voice holds is cached for a minute rather than an hour.
thesyncim
force-pushed
the
fix/ai-3484-one-app-cannot-hold-the-pool
branch
from
November 23, 2026 15:53
d7650d0 to
7dee5f4
Compare
thesyncim
marked this pull request as ready for review
November 23, 2026 15:54
kanat
reviewed
Nov 23, 2026
kanat
left a comment
Collaborator
There was a problem hiding this comment.
Round-1 review at 7dee5f4e3, merged onto main 31fd2dd96. CI is green on this head.
Checked and sound:
- Both touched suites pass on the merged tree, and
-race -count=20on the six concurrency and deadline tests passes. openapi.yaml, the JS types and the Go and Python clients match what their generators produce.- The export still reads in one REPEATABLE READ snapshot. DECLARE/FETCH run in that tx, and in a probe they returned rows in the same order and with the same plan as the plain query.
- #2201 merges clean with this PR, and its opt-out order tests pass on the merge.
- Slots are released by defers, so a crashed export cannot leak one.
- A miss key is dropped on create (agent_config.go:370, router_config.go:79, voice.go:72).
- The errors use APIError envelopes.
- Merge-tree: #2209 conflicts textually in store/redis.go, agent_config_test.go and router_config_test.go. #2221 merges clean.
Mutations: 19 checked. 6 survived: 4 are real (R1.1), and 2 are equivalent (R1.2).
Verdict: NO-GO, for R1.1 (four new rules have no test that pins them; the test rows are in the comment).
kanat
approved these changes
Nov 23, 2026
kanat
left a comment
Collaborator
There was a problem hiding this comment.
Verdict: GO, re-graded under this repo's pr-review skill (no Blocker, and no Should fix that has to land before merge). R1.1 is a test-coverage gap on code that behaves correctly, so it is a follow-up: the ready test rows are in the earlier review. The Nits stay optional.
thesyncim
added a commit
that referenced
this pull request
Nov 23, 2026
Follow-up to #2220 (Kanat's review). **Changes** - An import line that is not one JSON object is answered 400 with "an import is one JSON object per line", so a pretty-printed file, or two objects on one line, says what to change. - The spec says an app runs one export at a time on a router, and its 503 includes an export that ran out of time before its first row. - The data-move section of `acceleration/README.md` states the one export per app, the four exports per router, the hour and the minute per line, and the 64 MiB import line. - Two checks that could not change an answer are gone: a write deadline reset before an error that no line had preceded, and a context check before each batch of an export, whose next read fails on a cancelled context anyway. - The spec and the clients are regenerated. **Tests** - `TestAnExportCutAtItsDeadlineReadsAsBroken`: an export cut by its overall deadline reads as a broken response with no cursor line. It fails when the line deadline is not capped by the overall one. - `TestAnExportOutOfTimeBeforeItsFirstRowIsToldToTryAgain`: an export out of time before its first row is answered 503. It fails without the overall deadline, and with a 500 in place of the 503. - `TestAnImportWithBlankLinesIsRead`: an import with blank lines between its lines writes every row. It fails when blank lines are not skipped. Part of AI-3484
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.
Changes
conflictuntil the first ends.maxExports); one more is answered 503 until one ends.exportWait), or when one line has taken a minute to write (exportLineWait).exportBatchRows), so one that ends partway reads at most the rest of its batch before it lets go.Tests
TestASecondExportOfAnAppIsRefusedWhileOneIsRunning: a second export of an app is answered 409. It failed before the fix.TestOtherRequestsAreServedWhileExportsRun: another request is served while exports of one app run. It failed before the fix.TestOtherRequestsAreServedWhileExportsOfManyAppsRun: another request is served while exports of several apps run, and the fifth is answered 503. It failed before the fix.TestAnExportWhoseClientStopsReadingIsLetGo: an export nobody reads ends at the line deadline. It failed before the fix.TestAnExportReadSlowlyEndsAtItsDeadline: an export read slowly ends at its overall deadline. It failed before the fix.TestAnExportHungUpOnLetsGoAtOnce: an export hung up on a few lines into a large table ends within 2 s. It failed before the fix.TestAnImportLineOverTheLimitIsRefused: a line over 64 MiB is answered 413. It failed before the fix, with a 400.TestAnImportLineJustUnderTheLimitIsRead: a line one byte under 64 MiB is imported whole.TestANameNoConfigHoldsIsCachedForAMinuteOnly,TestANameNoRouterConfigHoldsIsCachedForAMinuteOnly,TestANameNoVoiceHoldsIsCachedForAMinuteOnly: a miss is cached for a minute and a hit for the hour. Each failed before the fix.Fixes AI-3484