Bug 1033404

Summary: Updating Blocking Bounded Queue and Bounded Queue Thread Pools fails without core-threads value
Product: [JBoss] JBoss Operations Network Reporter: Simeon Pinder <spinder>
Component: Plugin -- JBoss EAP 6Assignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Armine Hovsepyan <ahovsepy>
Severity: medium Docs Contact:
Priority: medium    
Version: JON 3.2CC: ahovsepy, jshaughn, loleary, mfoley, myarboro, tsegismo
Target Milestone: ER05   
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 13:59:26 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:
Attachments:
Description Flags
thread_pool_res
none
thread_pool_res_updated none

Description Simeon Pinder 2013-11-22 03:41:04 UTC
Description of problem:
If you attempt to update Blocking Bounded Queue or Bounded Queue thread pool instances without specifying a value for core-threads, the update will fail with non-descriptive response.

Version-Release number of selected component (if applicable):
JON 3.2.0.GA

How reproducible:
Every time.

Steps to Reproduce:
1. Import EAP 6.x instance into inventory and configure with valid connection settings.
2. Create Blocking Bounded Thread Pool instance without core-threads defined.
3. After successful creation, now attempt to update the same Thread pool instance again without setting a core-threads value.

Actual results:
Update fails.

Expected results:
Update should succeed.

Additional info:
Simple workaround is to apply add core-threads attribute value of 0 and the update succeeds.

Comment 3 Jay Shaughnessy 2014-09-05 02:54:10 UTC
Setting to ER04 for hopeful inclusion in 3.3.0, as time permits.

Comment 4 Jay Shaughnessy 2014-09-25 21:46:36 UTC
It's taken me a while to even get through the reproduction steps. There was a separate issue preventing creation if you didn't define the keepalive-time (I'll commit a fix for that shortly).  After that I could reproduce.  I think the issue may be in EAP, as the core-threads value can not be "unset", it basically must be set to an integer value and fails on null.  This seems like a bug to me since to get the documented default it needs to be unset.  The jboss CLI shows the same failure we are seeing.

Because on create we don't even send the value, it initializes fine.  But on update we need to be able to unset, in case a user had set a value and now wants to revert to the default behavior.

I may be able to partially fix this by not unsetting if it's already unset. But this wouldn't solve the issue of trying to unset after a value has been set.  I think I'll likely just open an EAP bug for this.  I'll consider the partial fix and see how much work it is, then report back...

Comment 5 Simeon Pinder 2014-09-29 08:12:41 UTC
Moving into ER05 as didn't make the ER04 cut.

Comment 6 Jay Shaughnessy 2014-09-29 19:25:45 UTC
master commit e7a641350e155c7cd6ed6c566491ef425aeee3e2
Author: Jay Shaughnessy <jshaughn>
Date:   Mon Sep 29 14:53:21 2014 -0400

 This is a partial fix for the reported issue, and contains two associated
 fixes  for issues hit while working the issue.
 - First, The plugin descriptor needs to specify required="false" for the
   optional simples in a map of simples, otherwise they will be set to
   required="true" by default (I don't know if this is true for all props, it
   may be, but it was definitely true for the keepalive-time map-of-simples for
   AS7 ThreadPools).  Otherwise values will be expected.  Fix this because this
   prevents the create child from working unless you sepcify keepalive-time.
 - Second, a map-of-Simples in a resource configuration always generates
   a Map in the Configuration, even if the Map is "empty" because the Simples
   are all "unset" (set to null values).  This was not being handled well in
   the create resource code, where an unset map should be ignored as if the
   entire PropertyMap is "unset".  Note that an empty MapProperty in a
   configuration update should be processed, because we may be trying to unset
   one or more of Simples that currently have a value.
 - Third, to work around the fact that AS can't currently handle an undefine
   (i.e update to null) of core-threads (and possibly other attributes), add
   an optimization such that we don't try to update undefined (null)
   attributes to be undefined, since they are undefined already.
 - There was another issue in that the plugin code was actually modifying
   the ConfigurationDefinition held in the ResourceContext (which is a
   weakness in our design that we even let that happen).  Changed to use a
   copy of the ConfigurationDefinition (and added a copy() method in the
   Entity, migrating it from plugin code where it was previously defined).

 So, the partial fix is that we can now create with empty maps and we can
 update without setting core-threads to a value, leaving it unset.  But once
 set core-threads can *not* be unset until the AS bug is fixed and the
 fixed version is a version being managed.



release/jon3.3.x commit 2c024accc57d27c86667fea238bb1be668f60f59
Author: Jay Shaughnessy <jshaughn>
Date:   Mon Sep 29 14:53:21 2014 -0400

    (cherry picked from commit e7a641350e155c7cd6ed6c566491ef425aeee3e2)
    Signed-off-by: Jay Shaughnessy <jshaughn>

Comment 8 Jay Shaughnessy 2014-10-08 17:15:49 UTC
As an aside, this is the EAP bug I created for the inability to undefine core-threads once it has a value:

https://bugzilla.redhat.com/show_bug.cgi?id=1147067

It's targeted for EAP 6.4 at this time.

Comment 10 Simeon Pinder 2014-10-21 20:24:17 UTC
Moving to ON_QA as available to test with the latest brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=394734

Comment 11 Armine Hovsepyan 2014-10-23 22:42:41 UTC
verified in JON 3.3 ER05
it is possible to create and edit 'blocking-bounded-queue-thread-pool' without providing 'core threads' count.

screen-shots of created/edited resources added.

Comment 12 Armine Hovsepyan 2014-10-23 22:46:26 UTC
Created attachment 950112 [details]
thread_pool_res

Comment 13 Armine Hovsepyan 2014-10-23 22:46:51 UTC
Created attachment 950113 [details]
thread_pool_res_updated