]
Stefan Gr commented on WFLY-11601:
----------------------------------
I'm just trying to resolve the issue. While browsing the source code I found the
attachment key _WEB_DEPENDENCIES_ which contains _ServiceName_'s that will be setup as
requirement for the _UndertowDeploymentService_. The _WeldDeploymentProcessor_ already
adds the _WeldStartService_ as a dependency to that attachment. Do you think it would be
enough to also add the _WeldStartupCompletionService_ to that attachment?
I will try that fix as soon as I have access to my dev machine. But maybe you can tell me,
if this may have any pitfalls and the fix won't work in all cases.
Weld vs Undertow bootstrap: Race condition
------------------------------------------
Key: WFLY-11601
URL:
https://issues.jboss.org/browse/WFLY-11601
Project: WildFly
Issue Type: Bug
Components: CDI / Weld, Web (Undertow)
Affects Versions: 15.0.1.Final
Reporter: Stefan Gr
Assignee: Matěj Novotný
Priority: Major
Attachments: TestApp.zip, TestLib.zip, changes.diff, deploy-failed.txt,
deploy-mixed-success.txt, deploy-success.txt, test-app-1.0.0.war,
weld-core-impl-3.0.5.Final.jar, weld-core-impl-3.0.5.Final.jar
WFLY-9732 / WFLY-10784 moves the completion of WELD from the WeldStartService to
WeldStartCompetionService. This causes a race condition with the UndertowDeploymentService
which executes the servlet listeners for context-initialized which again fires
ApplicationScope-initialized events in CDI.
You can find more in
[
WELD-2557|https://issues.jboss.org/browse/WELD-2557?focusedCommentId=1368...].
In short: WeldStartCompletionService and UndertowDeploymentService pushes the logic to
the executor service. It may happen, that the logik of undertow runs before the weld
completion. Events fired in the servlet listeners won't find all event observers.
A possible solution would bo to set the WeldStartCompletionService as a dependency of the
UndertowDeploymentService