DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=24159>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=24159


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[EMAIL PROTECTED]




------- Additional Comments From [EMAIL PROTECTED]  2006-03-31 16:02 -------

It also happended to us when printing a POJO that had to be initialized by
Hibernate. It hanged all the threads in the hole application. The fix was to
convert the object to string before logging it (e.g. log.debug("" + obj); ) We
had to go thru the hole system and modify all the occurrences.

I think the chances of this happening will increase as more libraries use lo

------- Additional Comments From [EMAIL PROTECTED]  2006-06-07 14:05 -------
We are hitting the same issue given the following:

- one thread logs a specially internationalized exception class with an
overriden getLocalizedMessage(Locale ) method that formats a message according
to the locale. We reuse the code doing the formatting from another class and
that reused code contains some log4j calls
- another thread triggers a logging simulateneously


We cannot use the "" + object trick as the logging of the object is initiated by
the printStackTrace which delegates to the VectorWriter.println(Object) call (in
our case the Object is the exception).




Our current solution is to disable the logging in our third party library that
does the formatting but this is not satisfying. We can try to remove the logging
from the third party library but that removes some functionality.

We believe the concurrent version of the Appender is the correct way to solve
the issue as given the log below, lock 04dbb288 in Thread 1 below wouldn't be
acquired. I don't see another solution right now.


Details:

Found one Java-level deadlock:
=============================
"Thread 1":
  waiting to lock monitor 0x00a89914 (object 0x04dbb830, a
org.apache.log4j.spi.RootCategory),
  which is held by "Thread 2"
"Thread 2":
  waiting to lock monitor 0x00a89934 (object 0x04dbb288, a
org.apache.log4j.ConsoleAppender),
  which is held by "Thread 1"

Java stack information for the threads listed above:
===================================================
"Thread 1":
        at org.apache.log4j.Category.callAppenders(Category.java:185)
        - waiting to lock <0x04dbb830> (a org.apache.log4j.spi.RootCategory)
        at org.apache.log4j.Category.forcedLog(Category.java:372)
        at org.apache.log4j.Category.debug(Category.java:241)
        at com.yyy.MyFormater.format(MyFormater.java:328)
        at com.xxx.MyException.getLocalizedMessage(MyException.java:273)
        at com.xxx.MyException.getLocalizedMessage(MyException.java:259)
        at java.lang.Throwable.toString(Throwable.java:344)
        at com.xxx.MyException.toString(MyException.java:334)
        at 
org.apache.log4j.spi.VectorWriter.println(ThrowableInformation.java:88)
        at java.lang.Throwable.printStackTrace(Throwable.java:510)
        - locked <0x06028c48> (a org.apache.log4j.spi.VectorWriter)
        at
org.apache.log4j.spi.ThrowableInformation.getThrowableStrRep(ThrowableInformation.java:50)
        at
org.apache.log4j.spi.LoggingEvent.getThrowableStrRep(LoggingEvent.java:333)
        at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:295)
        at org.apache.log4j.WriterAppender.append(WriterAppender.java:150)
        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
        - locked <0x04dbb288> (a org.apache.log4j.ConsoleAppender)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
        at org.apache.log4j.Category.callAppenders(Category.java:187)
        - locked <0x04dc4c08> (a org.apache.log4j.Logger)
        at org.apache.log4j.Category.forcedLog(Category.java:372)
        at org.apache.log4j.Category.error(Category.java:303)
        at com.xxx.Controller.handleError(Controller.java:92)
        [...]
"Thread 2":
        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:201)
        - waiting to lock <0x04dbb288> (a org.apache.log4j.ConsoleAppender)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
        at org.apache.log4j.Category.callAppenders(Category.java:187)
        - locked <0x04dbb830> (a org.apache.log4j.spi.RootCategory)
        at org.apache.log4j.Category.forcedLog(Category.java:372)
        at org.apache.log4j.Category.error(Category.java:286)
        at com.xxx.OtherController.handleError(OtherController.java:214)
        [...]

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to