Bug 648992

Summary: JON241: disabling plugin causes agent to send lots of additional availability reports
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.0CC: hbrock, mazz, sdharane
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 647930 Environment:
Last Closed: Type: ---
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: 647930    
Bug Blocks: 616081    

Description Charles Crouch 2010-11-02 17:07:48 UTC
+++ This bug was initially created as a clone of Bug #647930 +++

After disabling a plugin, the agent can begin to sends lots of availability reports to the server, more than expected. This happens if you have resources already in inventory (whether committed or not - i.e. in COMMITTED or NEW inventory status).

The problem is in :

org.rhq.core.pc.inventory.InventoryManager.mergeUnknownResources(Set<Integer>)

We weren't removing the IDs from the set being passed in by the caller, thus we never removed the resources that were disabled from the set.

Workaround: re-enable all plugins for which you have resources in inventory OR uninventory all resources that are in inventory that are of types found in plugins that are to be disabled. If the resources are in NEW status, you must commit them first, in order to be able to uninventory them. Its best to do this while the agents are down.

--- Additional comment from mazz on 2010-10-29 17:08:19 EDT ---

this is fixed - master commit: 7155896be74b82b2a9be7b1358103a4e2182fbcf

To test:

1) Start a RHQ Server and RHQ Agent
2) Commit the RHQ Server to inventory
3) Shutdown the agent
3) Go to Administration>Plugins and disable the rhq-server plugin
4) Restart the agent

Watch the server logs for about 10 minutes. After the initial sync between server and agent, you should not see availability reports getting sent up to the server every minute. The default avail scan is 5 minutes so when the agent reaches steady state, it should only send avail reports every 5 minutes. If you see avail reports come into the server every 30s or 60s after the agent has been running 5 or 10 minutes, this bug is still not fixed.

Comment 1 Sudhir D 2010-11-03 08:04:16 UTC
Verified this on the rhq-server-3.0.1-SNAPSHOT build. The issue has gone away. I don't see the availability report sent randomly. 

Marking this bug as verified.

Comment 2 Charles Crouch 2010-11-10 14:55:08 UTC
*** Bug 651886 has been marked as a duplicate of this bug. ***

Comment 3 Sudhir D 2010-11-12 11:04:31 UTC
Reverified this on jon-server-2.4.1-SNAPSHOT build# f188170. 

Report is sent only after 5 mins,
2010-11-12 16:17:20,144 INFO  [org.rhq.enterprise.server.core.AgentManagerBean] Agent with name [dhcp6-150] just went down
2010-11-12 16:18:45,239 INFO  [org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean] Disabling plugin [10010]
2010-11-12 16:19:42,040 INFO  [org.rhq.enterprise.server.core.CoreServerServiceImpl] Agent [dhcp6-150][3.0.1-SNAPSHOT(f188170)] would like to connect to this server
2010-11-12 16:19:42,131 INFO  [org.rhq.enterprise.server.core.CoreServerServiceImpl] Agent [dhcp6-150] has connected to this server at Fri Nov 12 16:19:42 IST 2010
2010-11-12 16:19:43,215 INFO  [org.rhq.enterprise.server.core.CoreServerServiceImpl] Got agent registration request for existing agent: dhcp6-150[10.65.201.129:16163][3.0.1-SNAPSHOT(f188170)] - Will not regenerate a new token
2010-11-12 16:19:58,162 INFO  [org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl] Processed AV:[dhcp6-150][297][full] - need full=[false] in (60)ms
2010-11-12 16:24:58,512 INFO  [org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl] Processed AV:[dhcp6-150][297][full] - need full=[false] in (60)ms

Comment 4 Corey Welton 2011-05-24 01:15:31 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 5 Corey Welton 2011-05-24 01:15:33 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 6 Corey Welton 2011-05-24 01:15:33 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 7 Corey Welton 2011-05-24 01:15:40 UTC
Bookkeeping - closing bug - fixed in recent release.