[jboss-jira] [JBoss JIRA] (WFCORE-1049) ConcreteResourceRegistration#registerSubModel is not thread safe
Brian Stansberry (JIRA)
issues at jboss.org
Fri Nov 6 07:58:00 EST 2015
[ https://issues.jboss.org/browse/WFCORE-1049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126356#comment-13126356 ]
Brian Stansberry commented on WFCORE-1049:
------------------------------------------
Here's one:
http://brontes.lab.eng.brq.redhat.com/viewLog.html?buildId=75813&tab=buildResultsDiv&buildTypeId=MasterWindows
{code}
05:18:46,317 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.ra.deployer."ear_packaged.ear#ear_packaged2.rar".jboss.ironjacamar.resource: org.jboss.msc.service.StartException in service jboss.ra.deployer."ear_packaged.ear#ear_packaged2.rar".jboss.ironjacamar.resource: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.jboss.as.connector.services.resourceadapters.IronJacamarActivationResourceService.start(IronJacamarActivationResourceService.java:196)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
... 3 more
{code}
The failing code is:
{code}
ManagementResourceRegistration cdRegistration = raRegistration.getSubModel(PathAddress.pathAddress(peCD));
ManagementResourceRegistration overrideCdRegistration = cdRegistration.registerOverrideModel(cm.getJndiName(), new OverrideDescriptionProvider() {
{code}
Dereferencing cdRegistration throws the NPE. It's null because raRegistration is a ref to an incompletely populated MRR.
I found another failure of that test, and it was in a different spot in IronJacamarActivationResourceService but the same basic pattern -- getSubModel is called on an MRR and it unexpectedly returns null.
These failures are hard to find in CI because its not a test method that fails, it's the preliminary ARQ setup (i.e. deployment) work. So you can't look up the test method in any test run and then check the history to find failures.
> ConcreteResourceRegistration#registerSubModel is not thread safe
> ----------------------------------------------------------------
>
> Key: WFCORE-1049
> URL: https://issues.jboss.org/browse/WFCORE-1049
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management
> Reporter: Stuart Douglas
> Assignee: Brian Stansberry
> Fix For: 3.0.0.Alpha1
>
>
> registerSubModel checks for existing, then registers, however it is invoked by two threads at the same time it is possible they will both see the resource as not existing and both register.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list