Skip to content

Conversation

@massfords
Copy link
Contributor

Summary

What does this PR do?

  • trying to avoid the Timeout errors we get when running, likely due to large volume of message. Easier to just use p-limit

@massfords massfords requested a review from jeffsays December 11, 2025 16:50
@jeffsays jeffsays added the bug Something isn't working label Dec 11, 2025
Copy link
Contributor

@jeffsays jeffsays left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to be working on a queue with >19k items without immediately crashing or timing out

Copy link
Contributor

@joshuanapoli joshuanapoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👋

Copy link
Contributor Author

@massfords massfords left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't ready to merge yet. I think your local branch has additional changes that got us through the re-drive.

The static config of p-limit instead of the reservedConcurrency or a param isn't a good general purpose solution.

Reverting to the aimd is also in play now that there's time to dig through this a little more to see why it flooded the client with the TimeoutError immediately after starting.

Comment on lines +301 to +302
// todo - can get the limit from the lambda's reserved concurrency, but 10 is a reasonable default
const limit = pLimit(10);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should merge this with this todo not done. The reserved concurrency should be available in the function config fetched above.

promises.push(
// eslint-disable-next-line no-loop-func
control(async (w: number) => {
limit(async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffsays I think your local branch had another change where the array of promises was awaited when it got too big. If we're going to maintain this tool, that should be merged into this since this solution still tipped over when there were hundreds of thousands of messages being re-driven.

@massfords massfords marked this pull request as draft December 27, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants