[
https://issues.redhat.com/browse/WFCORE-5240?page=com.atlassian.jira.plug...
]
Brian Stansberry commented on WFCORE-5240:
------------------------------------------
I think the use case needs a bit more of a think.
In the datasource and resource-adapter subsystem use cases, a putIfAbsent semantic may not
be correct. The semantic is only correct if the provided ResourceDefinition is equivalent
to the one the resulted in the existing MRR. And that may not be the case; e.g. in the r-a
case (and I think datasources too) the ResourceDefinition details depend on what stats are
provided by a particular rar. But the registration is, for example, against
{code}
/subsystem=resource-adapters/resource-adapter=*/connection-definition=foo
{code}
You can have services from two RAs that use competely different rars with very different
statistics both invoking that. That should not work.
For that to be safe, the registration would need to be against a concrete resource-adapter
address, not the wildcard:
{code}
/subsystem=resource-adapters/resource-adapter=bar/connection-definition=foo
{code}
But if that was the address, multiple calls is likely a bug, and a putIfAbsent semantic
(even the broken one currently used) would be wrong.
Add a ManagementResourceRegistration.registerSubModelIfAbsent method
--------------------------------------------------------------------
Key: WFCORE-5240
URL:
https://issues.redhat.com/browse/WFCORE-5240
Project: WildFly Core
Issue Type: Enhancement
Components: Management
Reporter: Brian Stansberry
Assignee: Brian Stansberry
Priority: Major
Subsystems, particularly datasources and resource-adapters, have code like this
that's called from service start methods:
https://github.com/wildfly/wildfly/blob/master/connector/src/main/java/or...
This is basically trying for a quasi putIfAbsent semantic. But it's not really
reliable, particularly if multiple services are doing the same thing during boot.
So, add a proper putIfAbsent-type submodel registration method to
ManagementResourceRegistration.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)