-
Notifications
You must be signed in to change notification settings - Fork 466
HttpResponse.disconnect() broken for ApacheHttpTransport #1303
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
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.