Bug 863092 - The state of the Plugin Container not consistent during resource upgrade
Summary: The state of the Plugin Container not consistent during resource upgrade
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On: 855744
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-04 12:21 UTC by Lukas Krejci
Modified: 2022-03-31 04:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 879655 0 unspecified CLOSED ResourceContainer can enter an inconsistent state after resource upgrade during agent startup 2021-02-22 00:41:40 UTC

Internal Links: 879655

Description Lukas Krejci 2012-10-04 12:21:21 UTC
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):
4.6.0-SNAPSHOT

How reproducible:
always

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


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