When using Apache as the underlying transport, issuing response.getContent().close() blocks waiting for the entire response to finish. If the source is the content from a GCS blob, this can potentially be many GB, which defeats the intention of disconnect().
Calling HttpResponse.disconnect() before .getContent().close() falls on the problem that disconnect() starts by calling getContent().close() before calling LowLevelHttpHandler.disconnect(). The wrong order, compared to the intended way for ApacheHttpClient.
The net effect is that the application-code get's blocked until all the blob-content have been read and discarded.
When using Apache as the underlying transport, issuing
response.getContent().close()blocks waiting for the entire response to finish. If the source is the content from a GCS blob, this can potentially be many GB, which defeats the intention ofdisconnect().Calling
HttpResponse.disconnect()before.getContent().close()falls on the problem thatdisconnect()starts by callinggetContent().close()before callingLowLevelHttpHandler.disconnect(). The wrong order, compared to the intended way for ApacheHttpClient.The net effect is that the application-code get's blocked until all the blob-content have been read and discarded.