Bug 869015

Summary: Provide more detailed logging when agent sends inventory report that contains deleted resource types
Product: [Other] RHQ Project Reporter: John Sanda <jsanda>
Component: Core ServerAssignee: Nobody <nobody>
Status: ON_QA --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.5CC: hrupp
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: 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 John Sanda 2012-10-22 18:55:07 UTC
Description of problem:
An agent can send the server an inventory report that contains one or more resource types that have been deleted on the server. This can happen after plugin deletion occurs on the server. The server throws an exception to let the agent know it needs to update its list of plugins. The exception results in a log message that says, "The report contains one or more resource types that have been marked for deletion." It would be helpful if we logged a message that lists what those resource types are.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 John Sanda 2012-10-22 19:09:20 UTC
Currently, we only log an ERROR message along with the stack trace in DiscoveryServerServiceImpl. This really should be logged at INFO because it is a normal, expected work flow.

Comment 2 John Sanda 2012-10-22 21:15:06 UTC
I have made a couple changes around the logging. DiscoveryBossBean will log a message like the following when it receives a report with one or more deleted types and when DEBUG logging is turned on,

DEBUG [org.rhq.enterprise.server.discovery.DiscoveryBossBean] The inventory report from Agent[id=0,name=192.168.1.19,address=null,port=0,remote-endpoint=null,last-availability-ping=null,last-availability-report=null] with added roots [Resource[id=0, uuid=da82a131-7491-4337-9e17-c4c006cf2b67, type={JBossAS7}JBossAS7 Standalone Server, key=/usr/local/var/jboss-as-7.1.1.Final/standalone, name=AS (127.0.0.1:9990), parent=192.168.1.19, version=7.1.1.Final]] contains these deleted resource types [ResourceType[id=0, name=JBossAS7 Standalone Server, plugin=JBossAS7, category=Server]]

And it will log this if INFO is turned on,

DEBUG [org.rhq.enterprise.server.discovery.DiscoveryBossBean] The inventory report from Agent[id=0,name=192.168.1.19,address=null,port=0,remote-endpoint=null,last-availability-ping=null,last-availability-report=null] contains these deleted resource types [ResourceType[id=0, name=JBossAS7 Standalone Server, plugin=JBossAS7, category=Server]]

DiscoveryServerServiceImpl has been refactored so that it no longer logs anything for the StaleTypeException. It just propagates the exception back to the agent.

Changes have been pushed to master.

master commit hash: c5c722c853ca0