[jboss-jira] [JBoss JIRA] (WFCORE-3039) Capability requirement can be lost if two attributes on same resource reference the same capability
Jeff Mesnil (JIRA)
issues at jboss.org
Tue Jun 26 10:36:00 EDT 2018
[ https://issues.jboss.org/browse/WFCORE-3039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13597155#comment-13597155 ]
Jeff Mesnil commented on WFCORE-3039:
-------------------------------------
I quickly looked at the code related to this failure.
In org.jboss.as.controller.OperationContext#registerAdditionalCapabilityRequirement, the method accepts an attribute parameter whose javadoc says "the name of the attribute that triggered this requirement, or {@code null} if no single attribute was responsible"
However in org.jboss.as.controller.AbstractAddStepHandler#recordCapabilitiesAndRequirements, when we record the requirements for the resource, we do:
1. add capability requirements for each attribute of the resource
2. get the context's resourceRegistration
3. for each requirements, we add capability requirements without specifying the attribute that triggered the requirement[1]
It seems that we should properly tracked the attribute that was responsible of the capability requirements in order to distinguish the "combined-providers" capability coming from either the final-providers or initial-provides attribute.
[1] https://github.com/wildfly/wildfly-core/blob/0e204bdabbe1ac8766cc59c9d259def82ef67026/controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java#L297 where attributeName is null
> Capability requirement can be lost if two attributes on same resource reference the same capability
> ---------------------------------------------------------------------------------------------------
>
> Key: WFCORE-3039
> URL: https://issues.jboss.org/browse/WFCORE-3039
> Project: WildFly Core
> Issue Type: Bug
> Components: Management
> Reporter: Darran Lofthouse
> Assignee: Radovan Netuka
>
> With the following three commands the server becomes unable to boot due to a missing dependency: -
> {noformat}
> /subsystem=elytron:write-attribute(name=initial-providers, value=combined-providers)
> /subsystem=elytron:undefine-attribute(name=final-providers)
> /subsystem=elytron/aggregate-providers=combined-providers:remove
> {noformat}
> If however I execute :reload after the first two commands, the final command will fail correctly.
> {noformat}
> [standalone at localhost:9990 /] /subsystem=elytron/aggregate-providers=combined-providers:remove
> {
> "outcome" => "failed",
> "failure-description" => "WFLYCTL0367: Cannot remove capability 'org.wildfly.security.providers.combined-providers' as it is required by other capabilities:
> capability 'org.wildfly.security.elytron' requires it for attribute 'initial-providers' at address '/subsystem=elytron'",
> "rolled-back" => true
> }
> {noformat}
> I am only listing the 'Domain Management' component as I believe the security example is just the reproducer.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list