Describe the bug
A clear and concise description of what the bug is.
I'm reusing same session in multiple tasks and concurrently launching them. my aws config looks like:
[profile a]
role_arn = xxx
source_profile= b
[profile b]
role_arn = xxx
credential_source = Ec2InstanceMetadata
and got this error:
Infinite loop in credential configuration detected. Attempting to load from profile yuxuanlu which has already been visited. Visited profiles: ['a', 'b'];
My suspicion is first task is accessing a then b, and marking b as visited, and second task encountered error when visiting b as well. Maybe a global lock is needed for credential management. I added an STS call before launching my tasks (so credentials are fetched and cached) and no longer seeing the issue:
async with self.boto_session.client("sts", region_name=self.region) as sts:
identity = await sts.get_caller_identity()
print(f"Caller identity: {identity}")
Checklist
pip freeze results
Environment:
- Python Version: 3.13.2
- OS name and version: linux
Additional context
Add any other context about the problem here.
Describe the bug
A clear and concise description of what the bug is.
I'm reusing same session in multiple tasks and concurrently launching them. my aws config looks like:
and got this error:
My suspicion is first task is accessing a then b, and marking b as visited, and second task encountered error when visiting b as well. Maybe a global lock is needed for credential management. I added an STS call before launching my tasks (so credentials are fetched and cached) and no longer seeing the issue:
Checklist
pip checkpasses without errorspip freezeresultspip freeze results
Environment:
Additional context
Add any other context about the problem here.