-
Notifications
You must be signed in to change notification settings - Fork 565
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
Ensures that the enabled flag is honored in JpaExtension's observer methods #8235
Ensures that the enabled flag is honored in JpaExtension's observer methods #8235
Conversation
…ethods Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
…ricsFactory in an @afterall rule Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
This pull request in its current state causes Weld to not be able to find things out about itself (!), but only when run in the pipeline (i.e. not locally):
This may have to do with Weld's See https://github.com/weld/core/blob/5.1.1.SP2/impl/src/main/java/org/jboss/weld/bean/builtin/BeanMetadataBean.java#L59. This is basically an assertion error in Weld itself; Weld cannot find an instance of I have no explanation yet for why running only in the pipeline would trigger an assertion error in Weld. I will retry the failing build a few times to ensure this isn't a pipeline-induced race condition or something of that nature (though the pipeline is single-threaded, as are the tests). It is at least conceivable this is related to #8122. |
Can reproduce locally with, e.g., |
Working theory: when Now need to see what's different. This is, at root, some kind of a Weld issue pertaining to very specific use cases where The first thing that occurs to me is the injection scenario here is:
…but there is something odd about trying to satisfy this (perfectly legal) injection point of an object ( |
…Bean metadata creation in certain codepaths Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
This is a wild one. I believe that the Weld bug or feature or codepath referred to above is: If the first encounter of demand for a contextual reference occurs as part of bringing up another contextual reference so that an observer method on it can invoked—specifically when the observer method "host" is being injected with its dependencies—then (and perhaps only then) the (required)
When tests (in the pipeline or anywhere) run in a different order, this state of affairs does not hold when this test runs. That of course shouldn't be the case, unless I'm missing something: surely this test should fail no matter where it runs since it creates a brand new container every time. My unconfirmed suspicion here is that because of the work we've done to make Weld run in native image there are static-like things lying around statically in At any rate, the easy workaround here is to ensure that an observer method that fires on container startup simply iterates through the I will look at the Weld codebase in detail later to see why the parent Finally, the archetype-related changes in this PR are all due to the hard work of @tjquinno who tracked down bad test initialization in the Helidon archetype (metrics were being cleared in a |
This PR ensures that the observer method at the bottom of the
JpaExtension
class honors theenabled
flag like other container-invoked methods in the class. Small oversight; shouldn't have any real-world effects either way.Documentation impact: none.