When PluginRegistry.stopAllPlugins() and then LogManager.shutdown() were called by Chainsaw on exit, LogManager.shutdown() caused the shutdown method to die inside the shutdown call.
I didn't research it. Sorry. -----Original Message----- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 5:44 PM To: 'Log4J Developers List' Subject: RE: Deadlock in ReaderWriterLock after calling LogManager.shutdown () Ceki, it's possible Scott Deboy may have spotted this too during Chainsaw development. We had to remove a LogManager.shutdown() call because it wouldn't seem to die. (Scott, is this correct? Sorry to speak for you... :) ) > -----Original Message----- > From: Andy McBride [mailto:[EMAIL PROTECTED] > Sent: Thursday, 19 June 2003 10:58 AM > To: [EMAIL PROTECTED] > Subject: Deadlock in ReaderWriterLock after calling > LogManager.shutdown > () > > > The following test class seems to hang at > LogManager.shutdown() when run with the jar produced by the current > cvs build (1.3alpha 18/06/03). This does not occur with the released > 1.2.8 jar. > > Further investigation points towards a deadlock in ReaderWriterLock. > Printing out the existing debug lines in ReaderWriterLock to sysout > produces the following output when run with the test class and config > below: > > Only tried on win2k pro. with jdk: > > java version "1.4.0" > Java(TM) 2 Runtime Environment, Standard Edition (build > 1.4.0-b92) > Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode) > > > > ReaderWriterLock: Asking for write lock > ReaderWriterLock: Got write lock > ReaderWriterLock: About to release write lock > piblicID: [null] > systemId: [dummy://log4j.dtd] > log4j: Threshold ="null". > ReaderWriterLock: Asking for write lock > ReaderWriterLock: Got write lock > ReaderWriterLock: About to release write lock > log4j: Class name: [org.apache.log4j.ConsoleAppender] > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > log4j: xml.DOMConfigurator - Handling nested <layout> for > appender CONSOLE > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > log4j: config.PropertySetter - Found setter method for property > [layout] in class org.apache.log4j. ConsoleAppender > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > log4j: xml.DOMConfigurator - Will instantiate instance of > class [org.apache.log4j.SimpleLayout] > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > log4j: config.PropertySetter - Set child component of type > [org.apache.log4j.SimpleLayout] for [org > .apache.log4j.ConsoleAppender]. > ReaderWriterLock: About to release read lock > log4j: Adding appender named [CONSOLE] to category [root]. > ReaderWriterLock: Asking for write lock > ReaderWriterLock: Got write lock > ReaderWriterLock: About to release write lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > DEBUG - Test debug message > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > INFO - Test info message > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > WARN - Test warn message > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ERROR - Test error message > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: About to release read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > FATAL - Test fatal message > java.lang.Exception: Test Exception > at com.jade.logtest.Tester2.<init>(Tester2.java:16) > at com.jade.logtest.Tester2.main(Tester2.java:26) > ReaderWriterLock: About to release read lock > Tester2: logging finished > Tester2: shutting down log4j: > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: Asking for read lock > ReaderWriterLock: Got read lock > ReaderWriterLock: Asking for write lock > > <<<!--- hangs here ---!>>> > > > test class: > > package com.jade.logtest; > > import org.apache.log4j.LogManager; > import org.apache.log4j.Logger; > > public class Tester2 > { > private Logger log = Logger.getLogger(Tester2.class); > > public Tester2() > { > log.debug("Test debug message"); > log.info("Test info message"); > log.warn("Test warn message"); > log.error("Test error message"); > log.fatal("Test fatal message", new Exception("Test Exception")); > System.out.println("Tester2: logging finished"); > > System.out.println("Tester2: shutting down log4j:"); > LogManager.shutdown(); > System.out.println("Tester2: log4j has been shutdown"); > } > > public static void main(String[] args) > { > new Tester2(); > } > } > > > > test config: > > <?xml version="1.0" encoding="UTF-8" ?> > <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> > > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" > debug="true"> > > <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> > <layout class="org.apache.log4j.SimpleLayout"/> > </appender> > > <root> > <appender-ref ref="CONSOLE"/> > </root> > > </log4j:configuration> > > > > I'm posting this to the dev list to see if somebody can confirm i'm > not being stupid. If so i can log it as a bug if required. > > Regards > > Andy > The information contained in this e-mail is intended only for > the person or > entity to which it is addressed and may contain confidential and/or > privileged material. If You are not the intended recipient > of this e-mail, > the use of this information or any disclosure, copying or > distribution is > Prohibited and may be unlawful. If you received this in error, please > contact the sender and delete the material from any computer. > The views > expressed in this e-mail may not necessarily be the views of > The PCMS Group > plc and should not be taken as authority to carry out any instruction > contained. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]