Repository navigation
Fix: Send the SSM batches in parallel - #17
Merged
Merged
Conversation
with more than 10 `bref-ssm:` variables the loader call `getParameters` once per 10 names, but it read each result before send the next batch, so the batches go one after the other and the cold start wait for every round trip. async-aws send the request when the result is created, so now all the batches are created first and read after. async-aws also throw a failure nobody read when the result is destructed, so every result is read even after one fail, and the first error is thrown after (same message for the 400 as before).
mnapoli
approved these changes
Nov 9, 2026
mnapoli
left a comment
Member
There was a problem hiding this comment.
Thank you, it's good to merge, can you fix the CI?
Contributor
Author
|
Hey @mnapoli, it should be fixed now. Thanks. |
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.
Hi,
When there is more than 10
bref-ssm:variables the loader split them in batches of 10 (the api limit), but it read the result of each batch before create the next one. So the requests go one after the other and the cold start wait for every round trip.async-aws send the request when the result is created, so now it create all the batches first and read them after. On our app (11 secrets) loading them went from ~130 ms to ~109 ms.
async-aws also throw a failure that nobody read when the result is destructed, so it read every result even when one fail, and throw the first error at the end (same clear message for the 400 as before).
added two tests: one check both requests are sent before any response is read (with a
MockHttpClient), the other that when every batch fail it still give the permissions message.Thanks.