fix(pusher): Prevent batch expiration recalculation on retry#1988
Draft
agarakan wants to merge 11 commits intosender-block-on-failurefrom
Draft
fix(pusher): Prevent batch expiration recalculation on retry#1988agarakan wants to merge 11 commits intosender-block-on-failurefrom
agarakan wants to merge 11 commits intosender-block-on-failurefrom
Conversation
jefchien
reviewed
Jan 16, 2026
|
|
||
| // Initialize start time before build() | ||
| batch.initializeStartTime() | ||
| batch.initializeStartTime(s.RetryDuration()) |
Contributor
There was a problem hiding this comment.
Update line 121 as well to use expireAfter.
agarakan
commented
Jan 17, 2026
| wg.Wait() | ||
| } | ||
|
|
||
| func TestResendWouldStopAfterExhaustedRetries(t *testing.T) { |
Contributor
Author
There was a problem hiding this comment.
Test is removed as redundant and would otherwise run for the entire default timeout period (14 days). Tested in Sender_test.go instead DropOnRetryExhaustion
6e76d60 to
409633b
Compare
jefchien
reviewed
Jan 20, 2026
Contributor
|
This PR was marked stale due to lack of activity. |
Verifies that startTime and expireAfter are only set once on first call and remain unchanged on subsequent calls, ensuring the 14-day expiration is measured from the first send attempt, not from each retry.
409633b to
4d798e2
Compare
Concurrency is now determined by whether workerPool and retryHeap are provided, making the explicit concurrency parameter redundant. 🤖 Assisted by AI
…THUB_OUTPUT errors
- TestPoisonPillScenario: Validates continuous batch generation with 10 denied + 1 allowed log group - TestSingleDeniedLogGroup: Baseline test with 1 denied + 1 allowed log group - TestRetryHeapSmallerThanFailingLogGroups: Demonstrates deadlock when heap size < failing log groups (SKIPPED) The third test intentionally deadlocks to prove the bug exists when: - Retry heap size = concurrency (2) - Number of failing log groups (10) > heap size (2) - Workers block trying to push to full heap - System deadlocks, starving allowed log group
Remove max size constraint from retry heap to prevent deadlock when failing log groups exceed concurrency limit. Changes: - Remove maxSize and semaphore from retryHeap struct - Make Push() non-blocking (no semaphore wait) - Remove semaphore release from PopReady() - Update NewRetryHeap() to ignore maxSize parameter (kept for API compatibility) - Update TestRetryHeap_SemaphoreBlockingAndUnblocking -> TestRetryHeap_UnboundedPush - Update TestRetryHeapSmallerThanFailingLogGroups to validate fix Before: With concurrency=2 and 10 failing log groups, retry heap (size=2) would fill up, causing workers to block on Push(), leading to deadlock. After: Retry heap is unbounded, allowing all failed batches to be queued without blocking workers. Allowed log groups continue publishing normally. Test results: - TestRetryHeapSmallerThanFailingLogGroups: PASS (5/5 allowed batches published) - Heap grew to size 28 (beyond concurrency limit of 2) - No deadlock or starvation
a22c968 to
6a6c0c6
Compare
This was referenced Feb 11, 2026
…move_maxretryduration # Conflicts: # .github/workflows/test-artifacts.yml
Contributor
|
This PR was marked stale due to lack of activity. |
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.
Description of the issue
Store expireAfter instead of maxRetryDuration for calculating the expiration of a batch request PLE.
Description of changes
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Unit tests
Requirements
Before committing your code, please do the following steps.
make fmtandmake fmt-shmake lintIntegration Tests
To run integration tests against this PR, add the
ready for testinglabel.