Skip to content

fix(batch): bound every batch with a finite default batch deadline (#275) - #765

Merged
s2x merged 4 commits into
masterfrom
fix/275-batch-deadline
Oct 24, 2026
Merged

s2x merged 4 commits into
masterfrom
fix/275-batch-deadline

Conversation

@s2x

@s2x s2x commented Oct 24, 2026

Copy link
Copy Markdown
Member

Closes #275.

Summary

  • TimeoutConfig::batchDeadlineMs now defaults to DEFAULT_BATCH_DEADLINE_MS (60000). An explicit 0 keeps the old unbounded behaviour (opt-out).
  • When > 0, the constructor rejects a deadline below any of the seven per-call timeouts that run inside a batch fan-out (readTimeoutMs is excluded: only point reads use it).
  • BatchAsyncExecutor::executeParallelCapped(): all windows now share one deadline budget, as its docblock promised. The deadline exception reports the configured deadline, the total elapsed time and every sub-batch without a result.
  • RawKvScanner: the budget is shared across the windows of one region batch, and a deadline no longer falls back to the unbounded sequential scan.
  • TxnKV: a deadline in the secondary-commit fan-out (after the commit point) is logged and commit() does not throw. A deadline in a rollback fan-out propagates and the transaction stays rollback-able.
  • The [RC-5] A single request can block a worker indefinitely #184 regression tests are kept; the new tests are in RawKvBatchDeadlineEnforcementTest.
  • Docs: configuration, operations, troubleshooting, error-handling, architecture, faq, decisions. The worst case is batchDeadlineMs plus one region's full retry loop.

BREAKING (CHANGELOG ### Changed, with a migration note): batches are now bounded by default. Set batchDeadlineMs to 0 to keep the old behaviour.

Not covered: the experimental BatchCommands path (RawKvBatch::tryMultiplex, off by default) has only a per-call limit.

Test plan

  • composer lint
  • composer test:unit (1973 tests)
  • composer test:grpc (321 tests; the 1 warning also occurs on master)
  • E2E in CI (local Docker is not available)

@s2x s2x self-assigned this Oct 24, 2026
@s2x
s2x merged commit d7837ca into master Oct 24, 2026
11 checks passed
@s2x
s2x deleted the fix/275-batch-deadline branch October 24, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GRPC-16] Pass a batch deadline from RawKvBatch to BatchAsyncExecutor

1 participant