Bug 1123375

Summary: Unexpected child set message in agent debug logs
Product: [JBoss] JBoss Operations Network Reporter: Jay Shaughnessy <jshaughn>
Component: AgentAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.2CC: myarboro, skondkar
Target Milestone: ER02   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:00:48 UTC 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 Jay Shaughnessy 2014-07-25 13:03:00 UTC
This is a JON bug for the issue described in Bug 801432 Comment 18:

"...I stumbled onto the log message added for Bug 801432 (see also Bug 807465).  In my agent log I saw messages like this when uninventorying resources:

2014-07-24 09:05:41,859 DEBUG [WorkerThread#0[127.0.0.1:54666]] (rhq.core.pc.inventory.InventoryManager)- [BZ 801432]
java.lang.Exception: Unexpected child set - if you see this, please notify support or log it in bugzillajava.util.HashSet:10230:test-simple.war
	at org.rhq.core.pc.inventory.InventoryManager.removeResourceAndIndicateIfScanIsNeeded(InventoryManager.java:1551)


This is a problem because it means that we are perhaps more susceptible to ConcurrentModificationException than we may have thought.  This indicates that we are working with HashSet when we are expecting to have the child resources in a safer Set impl."


The issue has been fixed upstream.  This is to track the fix for a JON release.  I would recommend 3.3 as it could prevent a troublesome ConcurrentModificationException.

Comment 1 Jay Shaughnessy 2014-08-22 20:22:06 UTC
commit 2d0cbf1e1a1d7bb9484eff06059a02ce14935bb2
Author: Jay Shaughnessy <jshaughn>
Date:   Fri Aug 22 16:20:46 2014 -0400

    [801432, 807465] Related Issue to these BZs
    Uninventory triggered our "assert-style" debug logging indicating that we
    were working with HashSet for child resources when we expected to be using
    a safer Set impl (wrt preventing ConcurrentModoficationException). There
    were a few issues in play:
    - When loading persisted resources from disk convert childResources to
      CopyOnWriteArraySet if necessary.  This repairs resources persisted with
      the wrong Set impl.
    - Eliminate some potential concurrent modification danger (or, at a minimum,
    - Fix a couple of other places where we weren't using CopyOnWriteArraySet
    - Fix Resource entity to ensure that when customChildResourcesCollection=tru
      that the childResources Set is truly protected. It was here that we were
      losing the proper Set impl.
      some unnecessary work) by only calling deactivateResource() on the root
      resource. It recursively deactivates the subtree, so no need to then call
      it on every node in the subtree.
    - Fix our "assert-logging" conditional, which despite finding this issue was
      actually looking for the wrong set impl. It had not been updated when we
      moved to CopyOnWriteArraySet.

    Cherry-Pick master 3e47741694b55fedecf9c904d89de11a7b92ccb2

Comment 2 Simeon Pinder 2014-09-03 20:31:25 UTC
Moving to ON_QA as available for test with the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=381194

Comment 3 Sunil Kondkar 2014-09-11 15:12:19 UTC
Verified on version :3.3.0.ER02 Build Number :4fbb183:7da54e2