Skip to content

fix: coalesce empty checkpoints#336

Merged
yaythomas merged 1 commit intoaws:mainfrom
AdityaAudi:feat/coalesce-empty-checkpoints-325
Apr 6, 2026
Merged

fix: coalesce empty checkpoints#336
yaythomas merged 1 commit intoaws:mainfrom
AdityaAudi:feat/coalesce-empty-checkpoints-325

Conversation

@AdityaAudi
Copy link
Copy Markdown
Contributor

@AdityaAudi AdityaAudi commented Apr 5, 2026

Summary

Implements the empty-checkpoint coalescing optimization described in #325.

When many concurrent map/parallel branches resume from a wait operation simultaneously, each branch's resubmitter enqueues an empty checkpoint (no OperationUpdate). Previously, these counted toward the 250-operation batch limit, causing 300 concurrent branches to produce 2 API calls (250 + 50) instead of 1.

  • Tracks effective_operation_count separately from len(batch)
  • The first empty checkpoint in a batch counts as 1 effective operation
  • All subsequent empty checkpoints in the same batch are coalesced in without incrementing the effective count
  • Applied consistently across all three collection phases: overflow queue drain, first-op blocking wait, and time-window loop
  • Updated debug logging to clearly show real ops sent vs empties excluded

@yaythomas yaythomas self-requested a review April 6, 2026 16:42
@yaythomas yaythomas moved this from Backlog to In review in aws-durable-execution Apr 6, 2026
@yaythomas yaythomas changed the title Coalesce empty checkpoints to reduce API calls in high-concurrency map/wait scenarios fix: coalesce empty checkpoints Apr 6, 2026
@yaythomas yaythomas force-pushed the feat/coalesce-empty-checkpoints-325 branch from 7d829d0 to 5bbf198 Compare April 6, 2026 17:46
Empty checkpoints (used by map/parallel branch resubmitters when resuming from timed waits) no longer count toward the 250-operation batch limit beyond the first. This prevents 300+ concurrent branch resumes from splitting across multiple API batches.

closes aws#325

Co-authored-by: Aditya Ganti <aditya.ganti95@gmail.com>
@yaythomas yaythomas force-pushed the feat/coalesce-empty-checkpoints-325 branch from 5bbf198 to 677980f Compare April 6, 2026 17:54
@yaythomas yaythomas dismissed their stale review April 6, 2026 17:55

fixes made

@yaythomas
Copy link
Copy Markdown
Contributor

thank you so much for picking this up @AdityaAudi, much appreciated! 🙇

@yaythomas yaythomas merged commit 2e0fcd6 into aws:main Apr 6, 2026
15 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in aws-durable-execution Apr 6, 2026
@AdityaAudi AdityaAudi deleted the feat/coalesce-empty-checkpoints-325 branch April 6, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants