Repository navigation
fix(throttler): continue draining queued tasks after a task fails - #11248
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where throttled task queues stopped processing remaining tasks when a task exhausted its retries or timed out, by ensuring this.process() is called after this.finish(error). New tests have been added to verify this behavior. Feedback highlights a potential memory leak and redundant promise resolutions in the finish method because the this.waits array is not cleared after iteration.
ajperel
force-pushed
the
ajp/throttler-drain
branch
2 times, most recently
from
October 9, 2026 22:00
b712165 to
2dac944
Compare
joehan
approved these changes
Oct 9, 2026
joehan
left a comment
Member
There was a problem hiding this comment.
Love a 1 line of real code, 1 changelog entry, 100 lines of tests PR
When a throttled task exhausted its retries or timed out, `Throttler` did not schedule the next waiting task into the freed concurrency slot. During Cloud Functions deployments, if all active concurrency slots failed, remaining queued functions were never scheduled and the CLI exited early with code `0` instead of reporting deployment errors. This change ensures the throttler continues processing queued tasks after a task failure. Part of #6989 Part of #11040 - Unit tests verifying that `Throttler` and `QueueExecutor` continue draining queued tasks after retry exhaustion or task timeouts. ```bash firebase deploy --only functions ```
ajperel
force-pushed
the
ajp/throttler-drain
branch
from
October 9, 2026 23:11
2dac944 to
a5c0f7e
Compare
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
When a throttled task exhausted its retries or timed out,
Throttlerdid not schedule the next waiting task into the freed concurrency slot. During Cloud Functions deployments, if all active concurrency slots failed, remaining queued functions were never scheduled and the CLI exited early with code0instead of reporting deployment errors.This change ensures the throttler continues processing queued tasks after a task failure.
Part of #6989
Part of #11040
Scenarios Tested
ThrottlerandQueueExecutorcontinue draining queued tasks after retry exhaustion or task timeouts.Sample Commands