Repository navigation
fix(render-farm): bound and validate instance credential refresh - #3374
Open
vedanth-jadhav wants to merge 1 commit into
Open
vedanth-jadhav wants to merge 1 commit into
vedanth-jadhav wants to merge 1 commit into
Conversation
Contributor
|
Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
With
RF_S3_IMDS=1, every storage operation waits for the same EC2 credential-refresh promise. Its three metadata fetches have no deadline and ignore HTTP status. A stalled request can hold all waiters indefinitely; an error or malformed credential response can overwrite the previous keys and cache an invalid expiration.Bound the complete token/role/credentials exchange to one five-second abort signal. Reject HTTP errors at every stage, empty token/role responses, failed credential status, missing fields and invalid/expired timestamps. Assign the new keys and cache timestamps only after validation. The existing shared refresh, successful-credential reuse and retry-after-failure behavior remain in place. Static-key configurations retain their early return.
Validation on Linux x86_64 / Bun 1.4.4:
noUncheckedIndexedAccess), Biome andgit diff --checkpass.Reproduce:
bun run --cwd apps/render-farm test. Real EC2 metadata and live AWS storage were not exercised. The five-second overall deadline deliberately fails a slow/unreachable metadata service instead of waiting indefinitely; callers can retry after the refresh promise clears. Errors do not include credential response bodies. No dependency, secret configuration or throughput changes.

Confidence Score: 5/5
This PR appears safe to merge.Summary
Bounds the complete EC2 credential exchange to five seconds and checks responses before replacing cached credentials.
Reviews (1) · Last reviewed commit: "fix(render-farm): bound and validate ins..." · Reviewed by Greptile