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

doOnEach not executed #1067

Closed
jmilkiewicz opened this issue Feb 10, 2018 · 4 comments
Closed

doOnEach not executed #1067

jmilkiewicz opened this issue Feb 10, 2018 · 4 comments
Labels
type/bug A general bug
Milestone

Comments

@jmilkiewicz
Copy link

jmilkiewicz commented Feb 10, 2018

As i started introducing MDC logging (according to https://simonbasle.github.io/2018/02/contextual-logging-with-reactor-context-and-mdc/)
i heavily rely on doOnEach for logging.

I started to experience that sometimes doOnEach is not executed.
At least this is what i observe in tests.

To reproduce the behavior please take a look at https://github.com/jmilkiewicz/doOnEachBug/blob/master/src/test/java/DoOneEachTest.java

The test shows that doOnEach (the one after map ) is simply not executed at all !
If i uncomment doOnEach (before map ) than everything works as expected !
Seems like map is spoiling something 😉

I also tried to build chain with 2 subsequent doOnEach (after map )

.map(x -> processMe(x)) 
.doOnEach(sig -> System.out.println("AFTERMap " + sig))
.doOnEach(sig -> {throw new RuntimeException("expected");})

but none of doOnEach is executed

I experience this behavior in Bismuth-SR5 ( 3.1.3.RELEASE)
If i downgrade to Bismuth-RELEASE (3.1.0.RELEASE)
than everything works fine and doOnEach is executed as expected

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

@smaldini
Copy link
Contributor

Thanks for the detailed report and good catch!
I added your test to master and it is working, you can try 3.1.4.BUILD-SNAPSHOT.
It has been already fixed by this a5647fc

@smaldini smaldini added this to the 3.1.4.RELEASE milestone Feb 11, 2018
@smaldini smaldini added the type/bug A general bug label Feb 11, 2018
smaldini pushed a commit that referenced this issue Feb 11, 2018
@jmilkiewicz
Copy link
Author

Hey

seems to work in 3.1.4.BUILD-SNAPSHOT.
BTW: can you tell me when 3.1.4 will be released ?

@smaldini
Copy link
Contributor

We're aiming for Thursday next week (+/- 1 day)

@simonbasle
Copy link
Member

I'll mention issue #1056 on my blog post in the meantime ;)

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

3 participants