On Wed, 2003-12-17 at 13:04, Prithi wrote:
> We are seeing a dead lock problem with log4j, during load test. Has anyone seen this 
> before. I have attached a sample log below.
>  
> Any help greatly appreciated.
>  
> Thanks - Prithi

Refer to this:

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

If any of your objects look like this, and if you log it from one
thread, and call set in another, you can deadlock.  I suggest you don't
do any sort of logging while holding any locks.  (Remove the log in the
set method...)

class State {
   Logger log1;
  
   synchronized void setState() {
     // Something takes a long time here
     log.debug("hello world");
   }

   synchronized Object getState() {
   }

   public String toString() {
      return "state=" + getState();
   }
}

>  
> 
> "ExecuteThread: '14' for queue: 'JmsDispatcher'" daemon prio=5 
> tid=0x2f8f88 nid=0x38 waiting on monitor [0xe4481000..0xe44819d8]
> 
> at java.lang.Object.wait(Native Method)
> 
> at java.lang.Object.wait(Object.java:415)
> 
> at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:94)
> 
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:118)
> 
> "ExecuteThread: '13' for queue: 'JmsDispatcher'" daemon prio=5 
> tid=0x2f8490 nid=0x37 waiting on monitor [0xe4581000..0xe45819d8]
> 
> at java.lang.Object.wait(Native Method)
> 
> at java.lang.Object.wait(Object.java:415)
> 
> at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:94)
> 
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:118)
> 
> FOUND A JAVA LEVEL DEADLOCK:
> 
> ----------------------------
> 
> "ExecuteThread: '1' for queue: 'default'":
> 
> waiting to lock monitor 0xb3bb8 (object 0xead732a0, a 
> org.apache.log4j.ConsoleAppender),
> 
> which is locked by "ExecuteThread: '9' for queue: 'default'"
> 
> "ExecuteThread: '9' for queue: 'default'":
> 
> waiting to lock monitor 0xb3a30 (object 0xead44548, a 
> org.apache.log4j.spi.RootCategory),
> 
> which is locked by "ExecuteThread: '1' for queue: 'default'"
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing



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

Reply via email to