[jboss-as7-dev] Working with MSC Services from a org.jboss.as.controller.AbstractRemoveStepHandler
Brian Stansberry
brian.stansberry at redhat.com
Thu Apr 26 10:59:20 EDT 2012
Do you have a service attempting to invoke a management op from within
its start() or stop() method? If so, you can't, as this is what will happen.
On 4/26/12 9:35 AM, David Bosschaert wrote:
> Hi all,
>
> I came upon an apparent deadlock when working with MSC services in the
> AbstractRemoveStepHandler.performRuntime()
>
> My code is like this:
> performRuntime(OperationContext context, ModelNode operation, ModelNode
> model) {
> sr = context.getServiceRegistry(true);
> ...
> which will hang under certain circumstances inside getServiceRegistry()
> What I'm trying to do here is obtain an MSC service inside the
> performRuntime() so I can make some calls on it.
>
> The stack trace is below [1]. I'm a little confused about the fact that
> it says 'locked 78fb1b0' and then a few lines up says 'waiting on
> 78fb1b0' in the same thread.
>
> Is this a bug? Or should I be interacting with services in a different
> way from here?
>
> I'm also attaching the full threaddump.txt in case someone is
> interested. I noticed that another thread is also doing something wrt to
> removing a resource, but I don't understand why that should block a
> service registry lookup.
>
> Thanks,
>
> David
>
> [1] "management-handler-thread - 2" prio=5 tid=0000000001a41000
> nid=0xb30e3000 in Object.wait() [00000000b30e2000]
> java.lang.Thread.State: WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <00000000078fd1b0> (a
> org.jboss.as.controller.ContainerStateMonitor)
> at java.lang.Object.wait(Object.java:485)
> at
> org.jboss.as.controller.ContainerStateMonitor.await(ContainerStateMonitor.java:153)
>
> - locked <00000000078fd1b0> (a
> org.jboss.as.controller.ContainerStateMonitor)
> at
> org.jboss.as.controller.ModelControllerImpl.awaitContainerMonitor(ModelControllerImpl.java:428)
>
> at
> org.jboss.as.controller.OperationContextImpl.awaitContainerMonitor(OperationContextImpl.java:373)
>
> at
> org.jboss.as.controller.OperationContextImpl.getServiceRegistry(OperationContextImpl.java:226)
>
> at
> org.jboss.as.configadmin.parser.ConfigAdminExtension.getConfigAdminService(ConfigAdminExtension.java:48)
>
> at
> org.jboss.as.configadmin.parser.ConfigurationRemove.performRuntime(ConfigurationRemove.java:48)
>
> at
> org.jboss.as.controller.AbstractRemoveStepHandler$1.execute(AbstractRemoveStepHandler.java:50)
>
> at
> org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385)
>
> at
> org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272)
>
> at
> org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200)
>
> at
> org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:466)
>
> at
> org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385)
>
> at
> org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272)
>
> at
> org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200)
>
> at
> org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:121)
>
> at
> org.jboss.as.controller.ModelControllerImpl$1.execute(ModelControllerImpl.java:304)
>
> at
> org.jboss.as.controller.ModelControllerImpl$1.execute(ModelControllerImpl.java:294)
>
> at
> org.jboss.as.configadmin.service.ConfigAdminServiceImpl.removeConfiguration(ConfigAdminServiceImpl.java:150)
>
> at
> org.jboss.as.configadmin.parser.ConfigurationRemove.performRuntime(ConfigurationRemove.java:50)
>
> at
> org.jboss.as.controller.AbstractRemoveStepHandler$1.execute(AbstractRemoveStepHandler.java:50)
>
> at
> org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385)
>
> at
> org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272)
>
> at
> org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200)
>
> at
> org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:466)
>
> at
> org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:385)
>
> at
> org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:272)
>
> at
> org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:200)
>
> at
> org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:121)
>
> at
> org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:139)
>
> at
> org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:108)
>
> at
> org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:287)
>
> at
> org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:487)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>
> at java.lang.Thread.run(Thread.java:680)
> at org.jboss.threads.JBossThread.run(JBossThread.java:122)
>
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
More information about the jboss-as7-dev
mailing list