Bug 833187

Summary: [as7] Empty lists should be null for some HornetQ sub-resources
Product: [Other] RHQ Project Reporter: Stefan Negrea <snegrea>
Component: PluginsAssignee: Stefan Negrea <snegrea>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.4CC: hrupp
Target Milestone: ---   
Target Release: RHQ 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 835696 (view as bug list) Environment:
Last Closed: 2013-09-01 10:07:40 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:
Bug Depends On:    
Bug Blocks: 707223, 835696    

Description Stefan Negrea 2012-06-18 20:22:36 UTC
Description of problem:
Three list properties should be sent as null if empty to the AS7. The current implementation treats all the lists in an equal manner, if the list is empty then an empty list is sent back to AS7 for a configuration update. The three list properties identified so far are: static-connectors (from Cluster Connection of HornetQ), static-connectors (from Bridge of HornetQ), and remoting-inceptors (of HornetQ).


How reproducible:
Every time

Steps to Reproduce:
1. Discovery and import an AS7 standalone server
2. Find the resource with the following path subsystem=messaging,hornetq-server=default,cluster-connection=my-cluster
3. Try to update the resource configuration.
  
Actual results:
The following error is received from AS7:
{JBAS014653: Composite operation failed and was rolled back. Steps that failed:={Operation step-16=JBAS014706: [0] is an invalid size for parameter static-connectors. A minimum length of [1] is required}},

Expected results:
The update should happen without an error.

Additional info:
For most cases sending an empty list back to the server is correct way of setting the property to empty; in those cases sending an null value will result in errors. So this update needs to be specific for the properties identified.

Comment 1 Stefan Negrea 2012-06-18 21:56:22 UTC
Added support for nullable lists. If a nullable list is empty then send back to the AS7 the null value instead of an empty list.

master branch commit:
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=755964e1ac732505f8ef2261e9ed601205679f29

Comment 2 Stefan Negrea 2012-08-14 19:37:23 UTC
A couple more updates were required to the loading and writing code for nullable lists. The code did not handle well the loading from JSON part.

One more commit to master branch:
http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=9e5352d85ca3b4ee98d52771930b61e72f73f579

Comment 3 Heiko W. Rupp 2013-09-01 10:07:40 UTC
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.