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

Inconsistent behaviour of concatDelayError #936

Closed
jebl01 opened this issue Nov 7, 2017 · 1 comment
Closed

Inconsistent behaviour of concatDelayError #936

jebl01 opened this issue Nov 7, 2017 · 1 comment
Assignees
Labels
type/bug A general bug
Milestone

Comments

@jebl01
Copy link

jebl01 commented Nov 7, 2017

Expected behavior

Flux.concatDelayError should always delay errors

Actual behavior

For a publisher of publishers errors are not delayed

Steps to reproduce

The following test is a minor modification of the test FluxConatMapTest.publisherOfPublisherDelayError. Just like that test, I expect this to succeed, but it fails with the message:
java.lang.AssertionError: expectation "expectNext(3)" failed (expected: onNext(3); actual: onError(java.lang.Exception: test))

@Test
public void publisherOfPublisherDelayErrorX() {
	StepVerifier.create(
			Flux.concatDelayError(
					Flux.just(
							Flux.just(1, 2),
							Flux.error(new Exception("test")),
							Flux.just(3, 4))))
			.expectNext(1, 2, 3, 4)
			.verifyErrorMessage("test");
}

Note that when calling Flux.concatDelayError with sources... instead of a publisher of publishers, the above test is successful.

Reactor Core version

3.1.0.RELEASE

JVM version

1.8.0_121

OS version

Darwin 57172 15.6.0 Darwin Kernel Version 15.6.0: Sun Jun 4 21:43:07 PDT 2017; root:xnu-3248.70.3~1/RELEASE_X86_64 x86_64

@simonbasle
Copy link
Member

This is indeed a bug with the Callable optimization pattern in concatMap, which doesn't take the delayError fully into account for Callable sources.

simonbasle added a commit that referenced this issue Nov 7, 2017
This commit ensures that concatDelayError and concatMapDelayError both
correctly delay the error from a Callable source (like Mono.error(t))
when the `veryEnd` mode is used, letting other sources be concatenated
before the error is propagated.
@simonbasle simonbasle self-assigned this Nov 7, 2017
@simonbasle simonbasle added the type/bug A general bug label Nov 7, 2017
@simonbasle simonbasle added this to the 3.1.2.RELEASE milestone Nov 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants