Skip to content
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

ReadCancellationException does not play well with onErrorContinue #24125

Closed
chringwer opened this issue Dec 3, 2019 · 2 comments
Closed

ReadCancellationException does not play well with onErrorContinue #24125

chringwer opened this issue Dec 3, 2019 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@chringwer
Copy link

The way that ReadCancellationException is used in BodyExtractors is apparently meant to be an implementation detail:

.map(buffer -> {
DataBufferUtils.release(buffer);
throw new ReadCancellationException();
})
.onErrorResume(ReadCancellationException.class, ex -> Mono.empty())

However, if somewhere downstream in the pipeline an onErrorContinue operator is appended, the exception does surface which caused me some confusion. Could this be implemented differently without throwing an exception?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 3, 2019
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Dec 3, 2019
@rstoyanchev rstoyanchev added this to the 5.2.3 milestone Dec 3, 2019
@rstoyanchev
Copy link
Contributor

Good point that a downstream onErrorContinue can quietly overtake onErrorResume handling and preclude buffer handling. Out of curiosity how did you even come across the issue?

We'll explore some alternative. We need to review similar handling elsewhere (e.g. DefaultWebClient).

@chringwer
Copy link
Author

I ran into it when using WebClient as a reactive source in spring cloud stream. Under the hood it was FluxMessageChannel from spring integration that registered the onErrorContinue operator here:
https://github.com/spring-projects/spring-integration/blob/v5.2.1.RELEASE/spring-integration-core/src/main/java/org/springframework/integration/channel/FluxMessageChannel.java#L85

But apparently, that has already been fixed by a commit a few minutes ago. :-)

However, thanks for looking into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants