Repository navigation
fix(batch): validate concurrency and rate-limit pause config - #1016
Closed
neverm1ndthat wants to merge 1 commit into
Closed
neverm1ndthat wants to merge 1 commit into
neverm1ndthat wants to merge 1 commit into
Conversation
Issue Stellar-split#1010 - reject invalid maxConcurrent values (non-integer, <= 0, NaN, Infinity) before any dispatch, and cap initial launch loop at min(maxConcurrent, invoiceIds.length) so extremely large values do not stall. Issue Stellar-split#1009 - validate rateLimitPauseMs, make retryAfterMs fall back safely on malformed hints, enforce monotonic pausedUntil (Math.max), and recheck the shared pause deadline after each sleep so workers do not wake early.
Author
|
Hi @Kingsman-99! This PR addresses Issues #1009 and #1010 - validates InvoiceBatchProcessor config (maxConcurrent must be positive int, rateLimitPauseMs must be non-negative), makes the rate-limit pause deadline monotonic, and caps initial launches at invoice count. All existing tests pass. PTAL! |
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.
Fixes #1009 and #1010
Summary
Validates
InvoiceBatchProcessorconfiguration and makes the rate-limit backoff monotonic.Issue #1010 - Concurrency bounds
The old code accepted non-integer, negative, zero, NaN, and Infinity values for
maxConcurrent. Infinity or extremely large integers could stall the initial launch loop.Fix:
maxConcurrentthat is not a positive integer before any dispatchMath.min(maxConcurrent, invoiceIds.length)Issue #1009 - Rate-limit pause authority
The old code accepted negative, fractional, NaN, and Infinity pauses. A second worker with a shorter Retry-After hint could shorten the shared pause. A worker falling asleep before a longer hint arrived would dispatch immediately on wake.
Fix:
rateLimitPauseMsis a non-negative integerisValidPauseMsbefore using thempausedUntilmonotonic:pausedUntil = Math.max(pausedUntil, nextPausedUntil)waitForGlobalPause()loopTesting
test/invoiceBatchProcessor.test.tscontinue to pass