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

Release dropped elements on collectList cancel/error #1342

Closed
rstoyanchev opened this issue Sep 6, 2018 · 1 comment
Closed

Release dropped elements on collectList cancel/error #1342

rstoyanchev opened this issue Sep 6, 2018 · 1 comment
Assignees
Milestone

Comments

@rstoyanchev
Copy link
Contributor

rstoyanchev commented Sep 6, 2018

The onDiscard hook added as part of #999 provides access to dropped data in case of an error or cancel signal but it looks like it doesn't cover cancellation everywhere, e.g. collectList.

A specific example of this could be making calls to remote HTTP services through the Spring Framework WebClient and zipping the results together. The codecs use DataBufferUtils#join which relies on collectList to aggregate data in some cases. So if one remote call errors or completes empty, others would be cancelled too potentially with in-flight data dropped. Other related examples could be based on timeout and retry.

@simonbasle
Copy link
Member

@rstoyanchev most operators supporting the onDiscard hook take the cancellation into account. collectList was not part of this set of supporting operators, but can be modified to "discard" the content of the accumulated List (precisely because the operator's implementation enforces the List type). (editing the issue's title accordingly)

On a related note, collectMap is based on the more generic collect, which doesn't enforce anything about the "container", so for both of these operators it would be trickier to implement onDiscard support 😢

@simonbasle simonbasle self-assigned this Sep 10, 2018
@simonbasle simonbasle added this to the 3.2.0.RELEASE milestone Sep 10, 2018
@simonbasle simonbasle changed the title Release dropped messages on cancel Release dropped elements on collectList cancel/error Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants