Skip to content

Provide API to ensure client response is drained #714

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
rstoyanchev opened this issue Apr 12, 2019 · 1 comment
Open

Provide API to ensure client response is drained #714

rstoyanchev opened this issue Apr 12, 2019 · 1 comment
Labels
type/enhancement A general enhancement

Comments

@rstoyanchev
Copy link
Contributor

rstoyanchev commented Apr 12, 2019

This is how consumeAndCancel is done in the WebClient for example. This isn't too bad but anything using HttpClient would need something similar and arguably Reactor Netty should have official API to encourage good behavior.

Then it gets more tricky if you want to do the same from a place where you don't know if the body has been consumed or not. You've to do something more like this where you try to consume and if an error occurs, suppress it expecting it's probably because the body has been read. This is fragile and could lead to issues like #503 that are very tricky to debug.

It would be useful if such an API provided options for how to drain, e.g. try to consume and if anything comes then cancel (like above), or perhaps allow reading up to a certain amount of data and/or timeout and then cancel.

@rstoyanchev rstoyanchev added the type/enhancement A general enhancement label Apr 12, 2019
@spencergibb
Copy link

Would be useful for spring Cloud Gateway

@violetagg violetagg added the status/need-triage A new issue that still need to be evaluated as a whole label Aug 2, 2019
@violetagg violetagg removed the status/need-triage A new issue that still need to be evaluated as a whole label Aug 29, 2019
@violetagg violetagg added this to the General Backlog milestone Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants