Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

HttpStorageRpc connection leakage #3379

Closed

Description

@steingrd

The class com.google.cloud.storage.spi.v1.HttpStorageRpc in google-cloud-storage provides two methods named open() that return the location header from the HTTP response. Both methods fail to properly close the underlying HTTP response returned from com.google.api.client.http.HttpRequest.

The javadoc on com.google.api.client.http.HttpRequest.execute() states:

Callers should call HttpResponse.disconnect when the 
returned HTTP response object is no longer needed.  
However, HttpResponse.disconnect does not have to be 
called if the response stream is properly closed

However the usage in HttpStorageRpc.open() extracts the location header and returns it directly without closing the http response:

HttpResponse response = httpRequest.execute();
if (response.getStatusCode() != 200) {
   throw buildStorageException(response.getStatusCode(), response.getStatusMessage());
}
return response.getHeaders().getLocation();

Activity

  1. added a commit that references this issue on Nov 4, 2025
    eca1ca1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: storageIssues related to the googleapis/java-storage API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions