[
https://issues.redhat.com/browse/WFLY-14273?page=com.atlassian.jira.plugi...
]
Brian Stansberry updated WFLY-14273:
------------------------------------
Description:
*Note: This is not simple stuff, so it should only be tackled by people with significant
management code expertise.*
Say your configuration has multiple resource-adapter resources, e.g. "my.rar.1",
"my.rar.2" etc. And say each of those has a connection-definition resource,
each of which has pool-name 'MyConnectionDefinition'. That's a legitimate
naming pattern. But because of the way the ManagementResourceRegistration for the RA
statistics is registered, there is a race condition that can lead to intermittent failures
at boot like the following:
{code}
2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5)
MSC000001: Failed to start service
jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS:
org.jboss.msc.service.StartException in service
jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed
to start service
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at
org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at
org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered
at
'/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
at
org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
at
org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
at
org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
{code}
I believe a similar thing could happen with 'admin-object' resources.
Note that I considered WFCORE-5240 as the foundation for a solution for this, but it's
not a valid foundation. There is no requirement that the MRR registered for different RA
should provide the same statistics, so two registration attempts cannot assume that any
existing MRR is the right one.
was:
Say your configuration has multiple resource-adapter resources, e.g. "my.rar.1",
"my.rar.2" etc. And say each of those has a connection-definition resource,
each of which has pool-name 'MyConnectionDefinition'. That's a legitimate
naming pattern. But because of the way the ManagementResourceRegistration for the RA
statistics is registered, there is a race condition that can lead to intermittent failures
at boot like the following:
{code}
2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5)
MSC000001: Failed to start service
jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS:
org.jboss.msc.service.StartException in service
jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed
to start service
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at
org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at
org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered
at
'/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
at
org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
at
org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
at
org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
{code}
I believe a similar thing could happen with 'admin-object' resources.
Note that I considered WFCORE-5240 as the foundation for a solution for this, but it's
not a valid foundation. There is no requirement that the MRR registered for different RA
should provide the same statistics, so two registration attempts cannot assume that any
existing MRR is the right one.
Avoid need for unique names for resource-adapter child resources that
provide statistics
----------------------------------------------------------------------------------------
Key: WFLY-14273
URL:
https://issues.redhat.com/browse/WFLY-14273
Project: WildFly
Issue Type: Enhancement
Components: JCA, Management
Reporter: Brian Stansberry
Assignee: Tomasz Adamski
Priority: Major
*Note: This is not simple stuff, so it should only be tackled by people with significant
management code expertise.*
Say your configuration has multiple resource-adapter resources, e.g.
"my.rar.1", "my.rar.2" etc. And say each of those has a
connection-definition resource, each of which has pool-name
'MyConnectionDefinition'. That's a legitimate naming pattern. But because of
the way the ManagementResourceRegistration for the RA statistics is registered, there is a
race condition that can lead to intermittent failures at boot like the following:
{code}
2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5)
MSC000001: Failed to start service
jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS:
org.jboss.msc.service.StartException in service
jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed
to start service
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at
org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at
org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered
at
'/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
at
org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
at
org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
at
org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
{code}
I believe a similar thing could happen with 'admin-object' resources.
Note that I considered WFCORE-5240 as the foundation for a solution for this, but
it's not a valid foundation. There is no requirement that the MRR registered for
different RA should provide the same statistics, so two registration attempts cannot
assume that any existing MRR is the right one.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)