Bug 863092

Summary: The state of the Plugin Container not consistent during resource upgrade
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.5CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=879655
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: ---
Bug Depends On: 855744    
Bug Blocks:    

Description Lukas Krejci 2012-10-04 08:21:21 EDT
Description of problem:

Resource upgrade is a stage during the Plugin Container startup where the InventoryManager goes through the freshly synced inventory and asks the individual resource components to upgrade their resource key (and possibly other things in the future) to a version compatible with the currently deployed version of the respective plugin.

The problem with this approach is that this happens during the InventoryManager initialization when the rest of the container services are not yet initialized and fully started up.

So if the resource component's start() method is called during resource upgrade and for example tries to use the EventContext or InventoryContext, the calls to these will most possibly fail because the backing container service managers haven't been initialized (they have been instantiated though).

We should consider modifying the startup sequence and/or the resource upgrade workflow for it a) run after the whole PC was initialized and b) before any of the actual subsystems start their work.

This is possibly going to require making some methods unavailable during the upgrade phase (throwing exceptions if in invalid state) but bug 855744 could bring a solid model of PCs lifecycle which the plugins could be made aware of and therefore could react accordingly.

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

How reproducible:

Steps to Reproduce:
1. Install RHQ 3.0.0, inventory an Apache server using it
2. Upgrade to RHQ 4.6.0-SNAPSHOT
3. Do plugins update on the agent prompt or restart the agent
4. Watch the agent.log for errors during resource upgrade
Actual results:
errors in the agent log notifying about problems during resource upgrade

Expected results:
no errors

Additional info:

The agent WILL successfully start up despite the errors