Bug 737159

Summary: jboss-cache plugin: several required resource config props are not being set by the plugin
Product: [Other] RHQ Project Reporter: Ian Springer <ian.springer>
Component: PluginsAssignee: Lukas Krejci <lkrejci>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1CC: hbrock, hrupp, jshaughn, lkrejci
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 625146    
Bug Blocks: 678340, 745494    
Attachments:
Description Flags
patch that fixes this issue, as well as several other bugs in the jboss-cache resource-config load/update code none

Description Ian Springer 2011-09-09 15:05:34 EDT
I noticed the following warnings in my Agent log:

2011-09-09 15:00:11,403 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Plugin Error: Invalid JBossCache resource configuration returned by JBossCache plugin - Required property 'NodeLockingScheme' has a null value in Configuration[id=0].
2011-09-09 15:00:11,403 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Plugin Error: Invalid JBossCache resource configuration returned by JBossCache plugin - Required property 'UseReplQueue' has a null value in Configuration[id=0].
2011-09-09 15:00:11,403 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Plugin Error: Invalid JBossCache resource configuration returned by JBossCache plugin - Required property 'ReplQueueInterval' has a null value in Configuration[id=0].
2011-09-09 15:00:11,403 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Plugin Error: Invalid JBossCache resource configuration returned by JBossCache plugin - Required property 'ReplQueueMaxElements' has a null value in Configuration[id=0].
2011-09-09 15:00:11,403 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Plugin Error: Invalid JBossCache resource configuration returned by JBossCache plugin - Required property 'FetchStateOnStartup' has a null value in Configuration[id=0].

These props should either be populated by the plugin or they should be changed to required="false". I suspect there is some bug in the plugin's resource config loading code that's preventing them from getting populated.
Comment 1 Ian Springer 2011-10-25 10:50:49 EDT
Created attachment 530111 [details]
patch that fixes this issue, as well as several other bugs in the jboss-cache resource-config load/update code
Comment 2 Ian Springer 2011-10-25 12:16:46 EDT
[master 5ee3245] (http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=5ee3245) fixes this as well as two other major issues in the jboss-cache resource config update:

1) 'attribute' elements that did not correspond to a resource config prop were excised from the file, badly corrupting it

2) for resource config props with null values, the 'attribute' elements were written out as:

<attribute name="foo" />

(i.e. not containing any text content), which is incorrect; instead they should not be written out at all.

and several minor issues: 

3) there were several other config props that should have been optional

4) duplicate "<depends>jboss:service=TransactionManager</depends>" lines added on every update

5) in config load, props were added to the config for every 'attribute' element found in the xml file, even ones that did not have corresponding prop defs in the config def; this resulted in superfluous props being persisted to the DB, which would not even be displayed in the GUI's config editor; it also indirectly resulted in major issue 1) above

QE: Note, these fixes can be tested using any JBoss AS 4.2.x instance running the 'all' config. As part of testing, after making various config updates, restart the AS instance and make sure there are no jboss-cache related errors during startup.
Comment 3 Mike Foley 2011-11-08 15:30:31 EST
reducing priority for qe verification as this is not in jon 3 branch
Comment 4 Lukas Krejci 2011-11-24 16:28:47 EST
QA failed.

By the looks of it there are more attributes that we should mark as optional. I found these (but don't claim the list to be exhaustive):

* TransactionManagerLookupClass (http://docs.jboss.org/jbossas/jboss4guide/r4/html/jbosscache.chapt.html#jbosscache-cache)

* InitialStateRetrievalTimeout - didn't find documentation suggesting it's optional but a config w/o this parameter doesn't cause any errors in the logs.
Comment 5 Jay Shaughnessy 2013-02-26 17:14:58 EST
Lukas, assigning this ips legacy bz to you given the above comments.