Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DBFF2F220 for ; Tue, 26 Mar 2013 06:17:19 +0000 (UTC) Received: (qmail 88577 invoked by uid 500); 26 Mar 2013 06:17:19 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 88226 invoked by uid 500); 26 Mar 2013 06:17:16 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 88156 invoked by uid 99); 26 Mar 2013 06:17:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Mar 2013 06:17:15 +0000 Date: Tue, 26 Mar 2013 06:17:15 +0000 (UTC) From: "Ralph Goers (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (LOG4J2-176) IllegalArgumentException during AsyncAppender shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ralph Goers resolved LOG4J2-176. -------------------------------- Resolution: Fixed Fix Version/s: 2.0-beta5 Assignee: Ralph Goers Fixed in revision 1460984. Please verify and close. > IllegalArgumentException during AsyncAppender shutdown > ------------------------------------------------------ > > Key: LOG4J2-176 > URL: https://issues.apache.org/jira/browse/LOG4J2-176 > Project: Log4j 2 > Issue Type: Bug > Components: Core > Affects Versions: 2.0-beta4 > Environment: Windows 2000, JDK1.6.0_031, single-cpu machine, multiple threads calling Logger.log > Reporter: Remko Popma > Assignee: Ralph Goers > Priority: Minor > Fix For: 2.0-beta5 > > > I am seeing the following exception: > Exception in thread "Thread-7" java.lang.IllegalArgumentException: Event is not a serialized LogEvent: Shutdown > at org.apache.logging.log4j.core.impl.Log4jLogEvent.deserialize(Log4jLogEvent.java:303) > at org.apache.logging.log4j.core.appender.AsynchAppender$AsynchThread.run(AsynchAppender.java:229) > (I cannot reproduce this on other platforms) > I think this is what is happening: > [AppThread] calls ((LifeCycle) LogManager.getContext()).stop(); > [AppThread] sets AsyncAppender.shutdown field to true (line 240) > [AsyncThread] breaks out of while(!shutdown) loop (line 196) > [AppThread] adds String "Shutdown" to queue > [AsyncThread] processes remaining items in the queue, tries to deserialize String "Shutdown" -> Error > Solution: > replace AsyncAppender line 229: > final Log4jLogEvent event = Log4jLogEvent.deserialize(queue.take()); > with > Serializable s = queue.take(); > if (SHUTDOWN.equals(s)) { continue; } // or break? > final Log4jLogEvent event = Log4jLogEvent.deserialize(s); > .... > I don't think this is a major issue as the AsyncThread will exit its run() method (so JVM can exit), it just looks a bit sloppy. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org