Bug 1033130 - [AS7] Exception during discovery of Query Cache resources of RHQ Server resource
Summary: [AS7] Exception during discovery of Query Cache resources of RHQ Server resource
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.10
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: RHQ 4.12
Assignee: Thomas Segismont
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 1107858
TreeView+ depends on / blocked
 
Reported: 2013-11-21 15:30 UTC by Thomas Segismont
Modified: 2014-12-15 11:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1107858 (view as bug list)
Environment:
Last Closed: 2014-12-15 11:36:14 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1022409 0 high CLOSED AS7 plugin: "Hibernate Persistence Unit" service does not show up 2021-02-22 00:41:40 UTC

Internal Links: 1022409

Description Thomas Segismont 2013-11-21 15:30:15 UTC
Description of problem:
An exception is thrown during discovery of Query Cache resources of RHQ Server resource

Version-Release number of selected component (if applicable):
4.10-SNAPSHOT

How reproducible:
Always

Steps to Reproduce:
1.Inventory RHQ Server resource
2.Watch the agent logs

Actual results:
2013-11-21 15:09:30,315 WARN  [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Failure during discovery for [Query Cache] Resources - failed after 75 ms.
java.lang.Exception: Discovery component invocation failed.
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:307)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalArgumentException: Plugin error: Resource key [deployment=rhq.ear,subdeployment=rhq-core-domain-ejb3.jar,subsystem=jpa,hibernate-persistence-unit=rhq.ear/rhq-core-domain-ejb3.jar#rhqpu,query-cache=SELECT_space_COUNT_left_paren__star__right_paren__newline_FROM_space_AlertDefinition_space_alertdefinition_newline_WHERE_space__left_paren__space_alertdefinition.group.id_space_IN_space__left_paren__space__colon_resourceGroupIds_space__right_paren__space__newline_AND_space_alertdefinition.deleted_space__equal__space__colon_deleted_space__right_paren__newline_] specified by [ResourceType[id=0, name=Query Cache, plugin=JBossAS7, category=Service]] discovery component is longer than the maximum length (500).
	at org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails.setResourceKey(DiscoveredResourceDetails.java:143)
	at org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails.<init>(DiscoveredResourceDetails.java:95)
	at org.rhq.modules.plugins.jbossas7.SubsystemDiscovery.discoverResources(SubsystemDiscovery.java:158)
	at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:303)
	... 4 more


Expected results:
No exception and successful discovery of all Query Cache resources

Comment 1 Thomas Segismont 2013-11-21 15:33:00 UTC
This could not happen before the fix for BZ1022409 because the whole "Hibernate Persistence Unit" resource was not discovered.

We're hitting the max length for resource keys

Comment 2 Thomas Segismont 2013-11-28 14:18:57 UTC
Fixed in master

commit 583c119780e0d69727de6c2a7bd6aaca33b22b69
Author: Thomas Segismont <tsegismo>
Date:   Thu Nov 28 15:18:06 2013 +0100

Query Cache management nodes have a very long name. So the default discovery class was creating a too long resource key and name.
 
Now there is a dedicated discovery class for Query Cache resources and the resource key and name are just the hash of the query-name attribute.

Comment 3 Thomas Segismont 2013-12-06 15:28:27 UTC
Back to ON_DEV as we figured out that for the RHQ Server resource only, 2000+ Query cache resources are inventoried.

The resource type will be commented out until we find a proper solution.

commit c7a1bad920666b9aec331441fef7da7d38c5f443
Author: Thomas Segismont <tsegismo>
Date:   Fri Dec 6 16:25:21 2013 +0100

Comment 4 Thomas Segismont 2014-06-12 21:51:06 UTC
Fixed in master

commit a3480101861ae6aed8f20d9010507602796504cc
Author: Thomas Segismont <tsegismo>
Date:   Thu Jun 12 23:48:37 2014 +0200

Instead of importing tons of Query Cache resources, AS7 plugin will mimic Hibernate Plugin's behavior and expose a "viewQueries" operation to gather the Query Cache nodes statistics.

Added HibernatePersistenceUnitComponent to implement "viewQueries" operation. The operation processes Query Cache nodes in batches to avoid sending too many queries to the management interface
Deleted the never used QueryCacheDiscovery class (updated API check file accordingly)
Removed the commented-out Query Cache service in AS7 plugin descriptor and added the "viewQueries" operation on the Hibernate Persistence Unit service
Added itest for the "viewQueries" operation

Comment 5 Heiko W. Rupp 2014-12-15 11:36:14 UTC
Bulk close of items fixed in RHQ 4.12

If you think this is not solved, then please open a *new* BZ and link to this one.


Note You need to log in before you can comment on or make changes to this bug.