Skip to content

fix: isolate memory-mode batches to prevent retry event poisoning#430

Open
MichaelGHSeg wants to merge 1 commit intoe2e-retry-fixesfrom
fix/memory-mode-batch-isolation
Open

fix: isolate memory-mode batches to prevent retry event poisoning#430
MichaelGHSeg wants to merge 1 commit intoe2e-retry-fixesfrom
fix/memory-mode-batch-isolation

Conversation

@MichaelGHSeg
Copy link
Copy Markdown
Contributor

Summary

  • flushData previously fetched ALL pending events as one batch. Failed retry events accumulated with new events, so a single non-retryable (400) event would poison the entire batch and drop events that should have been retried.
  • Added offset parameter to DataStore.fetch / MemoryStore / TransientDB and rewrote flushData to process events in flushAt-sized batches with offset tracking, matching file mode's per-file isolation.
  • On success/drop the array shifts and offset stays; on retryable failure offset advances past the batch; skipAllBatches returns immediately.

Test plan

  • All 46 existing e2e retry tests pass (retry-after, http-status-codes, x-retry-count, exponential-backoff, retry-integration)
  • All 6 new stress tests pass (mixed gauntlet, rate limit storm, alternating drop/retry, production-like sparse, consecutive variety, double retries)
  • Verify file-mode (DirectoryStore) is unaffected — offset parameter defaults to 0

🤖 Generated with Claude Code

flushData fetched ALL pending events as a single batch. When a failed
retry event accumulated with a new non-retryable event, the entire batch
was dropped — including events that should have been retried.

Add offset parameter to DataStore.fetch and process events in
flushAt-sized batches so each batch is independent, matching file mode
behavior where each file gets its own upload.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants