Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
High
-
Undefined
-
---
-
---
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:
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)
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.