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
WFLY-6402 EJBs accessible too early (spec violation) #8824
Conversation
Linux Build 9708 outcome was FAILURE using a merge of df61de1 |
Windows Build 4731 outcome was FAILURE using a merge of df61de1 |
retest this please!! |
Linux Build 9779 outcome was FAILURE using a merge of df61de1 |
Windows Build 4801 outcome was FAILURE using a merge of df61de1 |
retest this please |
Linux Build 9792 outcome was FAILURE using a merge of df61de1 |
Windows Build 4814 outcome was FAILURE using a merge of df61de1 |
Seems like this PR is failing consistently. |
@dmlloyd both failures occur while running SendMessagesTestCase times out: [15:06:16][org.wildfly:wildfly-ts-integ-basic] Running org.jboss.as.test.integration.ejb.mdb.containerstart.SendMessagesTestCase I wonder why test with security manager succeeds, though. Afaik the spec forces us to hold MDB 'calls' as well until startup beans' PostConstruct is done, right? Could it be I miss some aspect of how MDB work in such case? |
I'm not sure, it's pretty strange. Perhaps there's some race condition, and using a security manager upsets the timing to just the perfect degree that the race condition does not occur. This also might explain why the PR passed on the EAP branch. |
@@ -51,6 +51,7 @@ protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEAp | |||
if (data != null) { | |||
if (!data.getClassLevelAnnotations().isEmpty()) { | |||
description.initOnStartup(); | |||
description.getModuleDescription().registerStartupBean(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this only handle annotations, and not the deployment descriptor as well?
There are a number of fairly fundamental problems here:
I think this could be worked around by introducing a ThreadLocal that tracks if an invocation is a startup post construct invocation. Basically StartupCountDownInterceptor would set this to true, then clear it after the request. If this ThreadLocal was set then the other interceptor would not wait on the latch but just let the request through. Either way I still don't really like this, it would be better to stop all requests at the relevant endpoints until deployment is complete, much like we already do with graceful shutdown. |
Linux Build 9505 outcome was FAILURE using a merge of df61de1 |
Windows Build 4530 outcome was FAILURE using a merge of df61de1 |
retest this please |
Windows Build 4689 outcome was FAILURE using a merge of f252600 |
Linux Build 9652 outcome was FAILURE using a merge of f252600 |
Build log for failed build contains thread dump showing this: java.lang.Thread.State: WAITING (parking) (a direct call to CountDownLatch from StartupAwaitInterceptor) which is just not present in the current version of PR. Currently StartupCountdown class is used as an intermediate between these two. Probably CI is having trouble getting latest changes from amended commits or something. |
retest this please |
I agree that fundamental problem is that we should suspend at the remote endpoint level (e.g. no servlet, no remoting, etc) |
@n1hility doing that would be a proper solution for the problem, and that is what people are going to do for wildfly eventually. Current PR is just a way to fix spec violation until the code handling graceful startup arrives |
https://issues.jboss.org/browse/WFLY-6402
EJBs accessible too early (spec violation)
now all startup beans in deployment should finish their postconstruct methods before external calls would be allowed to proceed