Bug 1033130 - [AS7] Exception during discovery of Query Cache resources of RHQ Server resource
[AS7] Exception during discovery of Query Cache resources of RHQ Server resource
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
4.10
Unspecified Unspecified
unspecified Severity low (vote)
: ---
: RHQ 4.12
Assigned To: Thomas Segismont
Mike Foley
:
Depends On:
Blocks: 1107858
  Show dependency treegraph
 
Reported: 2013-11-21 10:30 EST by Thomas Segismont
Modified: 2014-12-15 06:36 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1107858 (view as bug list)
Environment:
Last Closed: 2014-12-15 06:36:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Thomas Segismont 2013-11-21 10:30:15 EST
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 10:33:00 EST
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 09:18:57 EST
Fixed in master

commit 583c119780e0d69727de6c2a7bd6aaca33b22b69
Author: Thomas Segismont <tsegismo@redhat.com>
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 10:28:27 EST
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@redhat.com>
Date:   Fri Dec 6 16:25:21 2013 +0100
Comment 4 Thomas Segismont 2014-06-12 17:51:06 EDT
Fixed in master

commit a3480101861ae6aed8f20d9010507602796504cc
Author: Thomas Segismont <tsegismo@redhat.com>
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 06:36:14 EST
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.