Add env variable to control aws identity cache timeout#1189
Closed
bbalser wants to merge 1 commit into
Closed
Conversation
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.
Summary
load_timeouton the AWS SDK identity cache infile_store::new_client, replacing the SDK default of 5 s. Allow override via theFILE_STORE_IDENTITY_LOAD_TIMEOUT_SECSenv var.mobile-packet-verifier backfill-sessionfailures of the formaws error: get_object (...) → dispatch failure → identity resolver timed out after 5s.Why
The S3 client is cached, but credentials inside it are loaded lazily by
IdentityCache::lazy()and re-fetched when they expire (~hourly on EC2/ECS via IMDS). The SDK's default 5 s identity-load timeout is too tight: when IMDS / STS briefly stalls, the next in-flightget_objectis failed.The backfill CLI hits this far more than the daemon because it issues
get_objectback-to-back at high rate over long runs, virtually guaranteeing a refresh will land on an active request.This restores the behavior of the previous
load_timeout(30s)setting (commit19b20186) that was removed in commit73d5511dduring an AWS SDK upgrade — that commit's message explicitly anticipated re-adding it "if we're still getting timeout failures." We are.Changes
file_store/src/lib.rsIdentityCacheimport andDurationto existing imports.FILE_STORE_IDENTITY_LOAD_TIMEOUT_SECSenv constant +identity_load_timeout()helper (default 30 s, falls back to default on parse failure).new_client, chain.identity_cache(IdentityCache::lazy().load_timeout(...).build())ontoaws_config::defaults(...).Single call site, so every
file_storeconsumer (price tracker, all verifiers, backfill CLIs, tests) inherits the longer timeout — no per-config plumbing.