Bug 1032627

Summary: /subsystem=logging/logger=any.category:assign-handler can't run under batch mode
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Rafael Ruiz <rafael.ruiz>
Component: LoggingAssignee: James Perkins <jperkins>
Status: CLOSED CURRENTRELEASE QA Contact: Nikoleta Hlavickova <nziakova>
Severity: medium Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.1.1CC: benevides, brian.stansberry, cdewolf, jperkins, myarboro, rafael.ruiz, rsvoboda, smumford
Target Milestone: Pending   
Target Release: EAP 6.2.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
An erroneous name attribute was added to the logging model in a previous version of JBoss EAP. This resulted in the operation trying to add the final handler name to the logger or async-handler multiple times. To correct this behavior, the name attribute is no longer added to the model and the operation correctly gets the handler name from the operation context. In this release of the product, adding handlers to a logger or async-handler in a composite operation works correctly.
Story Points: ---
Clone Of: 1017881 Environment:
Last Closed: 2014-06-02 12:49:10 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 Rafael Ruiz 2013-11-20 13:52:04 UTC
+++ This bug was initially created as a clone of Bug #1017881 +++

Description of problem:

Any attempt to run /subsystem=logging/logger=org.jboss.as.quickstarts.logging:assign-handler(xxx on CLI under the batch gives the following error:

{"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => "JBAS011536: Handler XXXX is already assigned."}}

This error doens't happen if the commands are not under a batch transaction


Steps to Reproduce:
1. Checkout https://github.com/jboss-developer/jboss-eap-quickstarts/tree/master/logging
2. Execute JBOSS_HOME/bin/jboss-cli.sh --connect --file=configure-logging.cli


Actual results:
{"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => "JBAS011536: Handler FATAL_QS_ASYNC is already assigned."}}

Expected results:
The batch executed successfully


Additional info:

--- Additional comment from James Perkins on 2013-10-29 12:38:10 EDT ---

I'm giving this a devel_ack+, but I don't think we should target EAP 6.2 for the fix. I can see what the issue is, but it needs to be thought through a bit. We can work around it by using the handlers property.

Example:
/subsystem=logging/logger=org.jboss.as.quickstarts.logging:add(level=TRACE, handlers=[TRACE_QS_ASYNC,DEBUG_QS_ASYNC,INFO_QS_ASYNC,WARN_QS_ASYNC,ERROR_QS_ASYNC,FATAL_QS_ASYNC])

One additional note about the scripts, the :reload isn't needed. All logging operations, minus a write-attribute to the asyn-handler's queue-length, are applied at runtime.

--- Additional comment from James Perkins on 2013-10-29 12:45:44 EDT ---

I forgot to add. I think we should delay from EAP 6.2 because the workaround is easy enough. The error is only going to occur in composite operations when using multiple add-handler operations to the same logger. 

If we need to get this into 6.2 it is possible, but at this stage I'm not sure it's worth the change for the simple workaround. Also I doubt this use-case, adding handlers to the same logger in a composite operation, is used all that often. This same issue is present in EAP 6.1.x and it's the first time I've seen it.

--- Additional comment from James Perkins on 2013-10-29 14:03:39 EDT ---

A selected the incorrect flag, I should have nack'd this one. I apologize for that.

--- Additional comment from Rafael Ruiz on 2013-11-20 07:19:06 EST ---

I have same error with EAP 6.1.1. Regardless which category you add. Putting it outside batch it works.

Comment 2 Scott Mumford 2014-02-27 06:11:56 UTC
This bug has been marked for inclusion in the 6.2.2 Release Notes.

To meet a PM request to have a draft of the document available for review by 4th March 2014, ECS requires assistance from someone involved with it's resolution.

If someone could review the Doc Text field above and fill out any blanks and correct any inaccuracies, a draft can be completed in a timely manner.

Comment 3 Scott Mumford 2014-03-03 04:00:40 UTC
Reformatted Doc Text field to prose. Will mark as documented once a technical review of the  Release Notes document has been performed.

Comment 5 Nikoleta Hlavickova 2014-03-04 08:22:24 UTC
Verified with EAP 6.2.2.CP.CR2