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

Polish corner cases in FluxLimitRequest, complete fast on cap=0 #2699

Merged
merged 3 commits into from
May 6, 2021

Conversation

simonbasle
Copy link
Contributor

This commit ensures that several corner cases are now covered in the
FluxLimitRequest operator:

  • a negative cap is rejected at assembly time
  • a zero cap leads to immediate completion of the actual during
    subscription. the source isn't even subscribed to.
  • extraneous onNext/onError are detected and dropped

Note that for eg. limitRequest(3), if the source emits exactly 3
elements then an onError, the limitRequest operator will still
consider itself onCompleted (and will now drop the error).

Similarly, Flux.error(th).limitRequest(0) will immediately complete
and the error won't be dropped in that case (since the error Flux won't
be subscribed to).

Fixes #2698.

This commit ensures that several corner cases are now covered in the
FluxLimitRequest operator:

 - a negative cap is rejected at assembly time
 - a zero cap leads to immediate completion of the actual during
 subscription. the source isn't even subscribed to.
 - extraneous onNext/onError are detected and dropped

Note that for eg. `limitRequest(3)`, if the source emits exactly 3
elements then an `onError`, the `limitRequest` operator will still
consider itself `onComplete`d (and will now drop the error).

Similarly, `Flux.error(th).limitRequest(0)` will immediately _complete_
and the error won't be dropped in that case (since the error Flux won't
be subscribed to).

Fixes #2698.
@simonbasle simonbasle requested a review from a team as a code owner May 5, 2021 10:11
@simonbasle simonbasle added the type/enhancement A general enhancement label May 5, 2021
@simonbasle simonbasle self-assigned this May 5, 2021
@simonbasle simonbasle requested a review from a team May 5, 2021 10:11
@simonbasle simonbasle changed the title Polish corner cases in FluxLimitRequest issue #2698 Polish corner cases in FluxLimitRequest, complete fast on 0 issue #2698 May 6, 2021
@simonbasle simonbasle changed the title Polish corner cases in FluxLimitRequest, complete fast on 0 issue #2698 Polish corner cases in FluxLimitRequest, complete fast on 0 - issue #2698 May 6, 2021
@simonbasle simonbasle added this to the 3.4.6 milestone May 6, 2021
@simonbasle simonbasle changed the title Polish corner cases in FluxLimitRequest, complete fast on 0 - issue #2698 Polish corner cases in FluxLimitRequest, complete fast on cap=0 May 6, 2021
@simonbasle simonbasle merged commit 0871105 into 3.3.x May 6, 2021
@reactorbot
Copy link

@simonbasle this PR seems to have been merged on a maintenance branch, please ensure the change is merge-forwarded to intermediate maintenance branches and up to main 🙇

@simonbasle simonbasle deleted the 2698-fluxLimitRequestPolish branch May 6, 2021 14:24
simonbasle added a commit that referenced this pull request May 6, 2021
simonbasle added a commit that referenced this pull request May 6, 2021
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

Successfully merging this pull request may close these issues.

3 participants