[cdi-dev] What, if any, guarantees are made about invoking asynchronous event observer methods?

Matej Novotny manovotn at redhat.com
Wed May 24 05:13:41 EDT 2017


Hey Laird, 

managed to figure out your TestScenario3[1] with FJP in single thread.
I feel silly for not noticing earlier, but the only real problem is that your test GH project used Weld 3.0.0.CR2[2] and the actual parallel option was added in 3.0.0.Final[3].
So, just upgrade your POM to 3.0.0.Final and it will magically work :)

Matej

_________________________________________________________________________________________________________
[1]https://github.com/ljnelson/weld-570/blob/master/src/test/java/weld/weld570/TestScenario3.java
[2]https://github.com/ljnelson/weld-570/blob/master/pom.xml#L63
[3]https://issues.jboss.org/browse/WELD-2353


----- Original Message -----
> From: "Laird Nelson" <ljnelson at gmail.com>
> To: "Matej Novotny" <manovotn at redhat.com>
> Cc: "cdi-dev" <cdi-dev at lists.jboss.org>
> Sent: Monday, May 15, 2017 5:25:10 PM
> Subject: Re: [cdi-dev] What, if any, guarantees are made about invoking asynchronous event observer methods?
> 
> On Mon, May 15, 2017 at 12:13 AM Matej Novotny <manovotn at redhat.com> wrote:
> 
> > TestScenario1/2 are pretty much what we are discussing here - the
> > container terminates and observers don't get notified any more.
> > Obviously, if you hang any additional 'thenRun' etc. on top of that, it
> > won't work either.
> >
> 
> Right.
> 
> 
> > TestScenario3 is with Weld parallel mode and is IMO out of scope of
> > previous discussion but important nonetheless.
> >
> 
> Yeah—this git repo was less a reproducer and more just me playing around.
> :-)
> 
> 
> > This is indeed weird and I think you are observing a peculiar behaviour of
> > default executor in SE, which is ForkJoinPool.
> > We have a test[1] for parallel execution in SE, where we defined your own
> > executor (see 'createWeld' method) and it works like a charm.
> > I think we need to look into FJP to see what's truly going on there.
> >
> 
> Oh, that is interesting.  OK; thanks.
> 
> Best,
> Laird
> 



More information about the cdi-dev mailing list