Skip to content

SessionTokenAuthenticationDetailsProvider httpClient resource leak #652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mbalamaruthu opened this issue Jan 20, 2025 · 0 comments
Open
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@mbalamaruthu
Copy link

We're using SessionTokenAuthenticationDetailsProvider for our local development and testing, Noticed that httpClient is not closed during refreshSessionToken.

The snippet causing the leak is as below. Kindly enclose within try or close the http client. Thanks.

`public synchronized boolean refreshSessionToken() {
com.oracle.bmc.Service service =
Services.serviceBuilder().serviceName("auth").serviceEndpointPrefix("auth").build();
String endpoint = Region.formatDefaultRegionEndpoint(service, region);
LOG.debug(
"Refreshing session token, refresh endpoint: {}/v1/authentication/refresh",
endpoint);

    try {
        HttpClient httpClient =
                HttpProvider.getDefault()
                        .newBuilder()
                        .baseUri(endpoint)
                        .registerRequestInterceptor(
                                Priorities.AUTHENTICATION,
                                new AuthnClientFilter(
                                        DefaultRequestSigner.createRequestSigner(this),
                                        Collections.emptyMap()))
                        .build();

        SessionTokenRefreshRequest request =
                new SessionTokenRefreshRequest((this.sessionToken));`
@richachugh11 richachugh11 added the SDK Issue pertains to the SDK itself and not specific to any service label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

2 participants