Skip to content

feat(amber): reject nonpositive network batch sizes - #9640

Draft
Matthew-DWM wants to merge 1 commit into
apache:mainfrom
Matthew-DWM:feat/reject-nonpositive-batch-size
Draft

Matthew-DWM wants to merge 1 commit into
apache:mainfrom
Matthew-DWM:feat/reject-nonpositive-batch-size

Conversation

@Matthew-DWM

Copy link
Copy Markdown

What changes were proposed in this PR?

NetworkOutputBuffer now rejects a batch size below 1 when it is built. Before, 0 or a negative value was accepted, and its buffer.size >= batchSize check was then true after every tuple, so the run silently sent one message per tuple.

The settings panel already requires at least 1. Settings from saved or imported workflows and from the API (SyncExecutionResource) skip that check and reach the buffer through ResourceAllocator → LinkConfig → OutputManager.

Before:  dataTransferBatchSize = 0  ->  run COMPLETED, one message per tuple
After:   dataTransferBatchSize = 0  ->  run FAILED at start, before any data moves:
         "requirement failed: Data transfer batch size must be at least 1, got 0"

In NetworkOutputBufferSpec, one test replaces the characterization and pendingUntilFixed tests that were left for this change. It checks that 0, -1 and Int.MinValue are rejected with that message.

This builds on #8090 by @carloea2.

Any related issues, documentation, discussions?

Closes #8089

How was this PR tested?

  • The new test fails on main (no exception is thrown) and passes with the fix. NetworkOutputBufferSpec passes 17/17.
  • Amber unit tests (AMBER_TEST_FILTER=skip-integration, 2430/2430) and integration tests (integration-only, 47/47) pass. scalafmtCheckAll and scalafixAll --check are clean.
  • Engine run, CSV scan → Keyword Search on 1,000 rows, at batch sizes 400, 1, 0 and -1. Before, all four complete with 1,000 rows. After, 400 and 1 still do, and 0 and -1 fail at start with the message above.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

NetworkOutputBuffer accepted a data transfer batch size of 0 or less. Its
`buffer.size >= batchSize` check is then true after every tuple, so a bad
setting silently sent one message per tuple. The settings panel requires at
least 1, but saved, imported and API-sent settings skip that check. The
constructor now rejects a batch size below 1, so such a run fails at start
with "Data transfer batch size must be at least 1, got <n>".
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @aglinxinyuan
    You can notify them by mentioning @aglinxinyuan in a comment.

@Matthew-DWM
Matthew-DWM marked this pull request as draft November 23, 2026 17:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nonpositive network batch sizes are accepted

1 participant