Branch: refs/heads/master Home: https://github.com/rhq-project/rhq Commit: cdc471aee9fd89f9a5226a19f92e0bdfb0a11f3a https://github.com/rhq-project/rhq/commit/cdc471aee9fd89f9a5226a19f92e0bdfb0... Author: Jay Shaughnessy jshaughn@redhat.com Date: 2014-03-16 (Sun, 16 Mar 2014)
Changed paths: M modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceErrorType.java M modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
Log Message: ----------- [1073201] Agent does a discovery loop if the inventory contains an unknown resource It's possible to disable a plugin on an agent after resources of that plugin's types are already in server-side inventory. The server will report those resources to the agent during an inventory sync. The agent will treat them as "unknown" resources because those resources will not have containers.
This fixes the handling for unknown resources with disabled resource types. It ensures they are not merged into agent-side inventory and also do not trigger further discovery scans. Additionally, it now generates a ResourceError for the server-side resource to help notify the user that the resource is no longer being managed, and should be uninventoried. Only uninventory will stop the inventory sync overhead.
Commit: 72550f24284c25f467107b920f94770041dae117 https://github.com/rhq-project/rhq/commit/72550f24284c25f467107b920f94770041... Author: Jay Shaughnessy jshaughn@redhat.com Date: 2014-03-16 (Sun, 16 Mar 2014)
Changed paths: M modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/discovery/DiscoveryAgentService.java M modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java M modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java M modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanTest.java M modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/configuration/LargeGroupPluginConfigurationTest.java M modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java M modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java
Log Message: ----------- [1073201] Agent does a discovery loop if the inventory contains an unknown resource Patch supplied by elias_ross@apple.com. The patch worked around the issue although in a prior commit I put in a fix for the core issue. But the patch is also useful. I'm applying parts of it, manually, as applying it verbatim was not applicable after my initial change.
Thanks Elias!
----------------------------------- Original Patch Comment:
The main fix is keeping a reference to the scheduled service rescan Future and prevent a scan from being scheduled again before execution. This also has executeServiceScanDeferred() work the same way.
The other related fixes are for: 1) Only do availability checking for synched/merged/deleted resources, not a full scan. As we have the references for this, it seems worthwhile to prevents lots of scans (and overloading the server) if an unknown resource shows up. 2) Concurrency. Setters/getters should be synchronized if accessed across threads. 3) Use 0 for scan time, as we can then avoid getting system time. 4) In cases Executor.submit(Callable) is used and Future isn't needed, use Runnable instead. -----------------------------------
A couple of modifications: - set availabilityCheck time to 1, as opposed to 0, because 0 indicates an initialized state and does not guarantee an avail check is perfomed. - when requesting an avail check for an unknown resource, make it recursive so the unknown children also get checked.
Additionally, now when updating plugin config, root the ensuing discovery at the updated resource.
Compare: https://github.com/rhq-project/rhq/compare/fe43668a7239...72550f24284c
rhq-commits@lists.fedorahosted.org