Bug 1093030

Summary: Inconsistent behaviour for read-children-names operation
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: Domain ManagementAssignee: Brian Stansberry <brian.stansberry>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.3.0CC: emuckenh, kkhan, myarboro, smumford
Target Milestone: ER4   
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
In previous releases of JBoss EAP 6, the handlers for the read-children-names and read-children-resources operations only treated the value of a child-type parameter as a value if there was a registered resource definition for some variant of that type, e.g. a generic registration for '*' and/or some specific registration. The existence of an entry in the resource definition tree for the type alone was insufficient. Starting a server in a managed domain would result in an entry in the resource definition tree for type 'server', as well as a specific entry of that type for the server. Stopping all servers would result in all specific entries being removed, but the type definition remained. As a result invoking read-children-names or read-children-resources on the host resource, with the child-type param set to 'server' would result in a failure with the message: ---- JBAS014793: No known child type named server ---- In this release, if a child type is registered but there are no specific resource definition entries, the handlers for read-children-names and read-children-resources treat the child type as valid and respond with an empty list instead of with a failure. Now, if the response to a call to read-children-types on a resource includes a particular child type, then a call to read-children-names or read-children-resources will not fail (assuming there has been no change in state between the calls.)
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-28 15:38:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Kremensky 2014-04-30 12:56:21 UTC
Description of problem:
 read-children-names operation is behaving inconsistently on /host=master/server node. On every other existing node this operation returns empty list, but if I stop every server in domain, and run the operation on 'server' child-type, I get "JBAS014793: No known child type named server" message -> indicating that 'server' is not a known child-type.

Version-Release number of selected component (if applicable):
 EAP 6.3.0.ER2

How reproducible:
 Always

Steps to Reproduce:
 1. Start out-of-box domain and connect to CLI
 2. Run following set of commands to stop and remove all default servers
/host=master/server-config=server-one:stop()
/host=master/server-config=server-two:stop()

/host=master/server-config=server-one:remove()
/host=master/server-config=server-two:remove()
/host=master/server-config=server-three:remove()

 3. Note, that 'server' node is listed among available children types for /host=master node
/host=master:read-children-types
{
    "outcome" => "success",
    "result" => [
        "core-service",
        "interface",
        "jvm",
        "path",
        "server",
        "server-config",
        "system-property"
    ]
}

 4. Run read-children-names operation on 'server' and 'server-config' child-type.

Actual results:
/host=master:read-children-names(child-type=server-config)
{
    "outcome" => "success",
    "result" => []
}
/host=master:read-children-names(child-type=server)
{
    "outcome" => "failed",
    "failure-description" => "JBAS014793: No known child type named server",
    "rolled-back" => true
}

Expected results:
/host=master:read-children-names(child-type=server-config)
{
    "outcome" => "success",
    "result" => []
}
/host=master:read-children-names(child-type=server)
{
    "outcome" => "success",
    "result" => []
}

Additional info:
 We may also update the message in org.jboss.as.controller.ControllerMessages from "No known child type named %s" to "No known child-type named %s"

Comment 2 Petr Kremensky 2014-05-14 10:36:03 UTC
Verified on EAP 6.3.0.ER4.