Bug 969126 - Prevent possible deadlock in logging handlers when two threads invoke the error handler
Prevent possible deadlock in logging handlers when two threads invoke the err...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: James Perkins
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-30 13:32 EDT by Kyle Lape
Modified: 2014-08-19 12:19 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-19 12:19:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kyle Lape 2013-05-30 13:32:42 EDT
There is a potential to have a deadlock if two threads are invoking logging handlers and both threads end up invoking the error handler for their logging handler.  

The way the deadlock works is 

- Thread 1 invokes the error handler
- The error handler writes to System.out.println
- This is routed back into the logging subsystem via jboss-stdio
- As usual, JBoss LogManager will send the message to all appropriate handlers
- The thread halts, waiting on a lock for the handler locked by thread 2

- Thread 2 is running in a different handler for which it has a lock
- This lock must have been obtained after thread 1 invoked this handler but before the error handler from thread 1 tried to invoke the same handler
- This handler also invokes its error handler
- The error handler halts, waiting on the lock for System.out, held by thread 1
Comment 2 James Perkins 2013-08-27 13:42:13 EDT
I think this relates to https://bugzilla.redhat.com/show_bug.cgi?id=961702 and has been fixed in the LogManager by using the org.jboss.logmanager.errormanager.OnlyOnceErrorManager. The JIRA was LOGMGR-65 and the LogManager PR was https://github.com/jboss-logging/jboss-logmanager/pull/18. This fix made it into jboss-logmanager-1.4.3.Final which made it into EAP 6.1.1.

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