Skip to content

DefaultProfile inconsistent behavior #966

Open
@jiaheng

Description

@jiaheng
  • Product and API: KMS, SecretManagerClient
  • Platform: Java
  • Mininum Code:
            DefaultProfile profile = DefaultProfile.getProfile(region);
            profile.setCloseTrace(true);
            SecretManagerClient secretManagerClient =
                    BaseSecretManagerClientBuilder.standard()
                            .withCredentialsProvider(
                                    createCredentialsProvider(assumeRoleArn, region))
                            .withRegion(region)
                            .build();
            return SecretCacheClientBuilder.newCacheClientBuilder(secretManagerClient).build();

I noticed a potential inconsistency in the DefaultProfile class, particularly in lines 70-72:

public synchronized static DefaultProfile getProfile(String regionId) {
return new DefaultProfile(regionId);
}

Most of the getProfile methods assign a new DefaultProfile instance to the profile variable, but one method does not follow this pattern. This discrepancy could impact clients relying on this profile, potentially leading to issues like inconsistent trace disabling behavior. Could you clarify if this is the intended behavior or if it might be a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions