Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 13379 invoked from network); 28 May 2002 23:37:18 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 28 May 2002 23:37:18 -0000 Received: (qmail 14928 invoked by uid 97); 28 May 2002 23:37:22 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 14873 invoked by uid 97); 28 May 2002 23:37:21 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 14861 invoked by uid 98); 28 May 2002 23:37:21 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="hSIA/mwzlm" Content-Transfer-Encoding: 7bit Message-ID: <15604.5120.813550.537659@slab.corp.buildpoint.com> Date: Tue, 28 May 2002 16:34:24 -0700 From: Gregory Steuck Sender: avalon-dev-return-10375-greg=buildpoint.com@jakarta.apache.org To: "Avalon Developers List" Subject: TPCThreadManager exceptions X-Mailer: VM 7.00 under 21.4 (patch 8) "Honest Recruiter" XEmacs Lucid X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --hSIA/mwzlm Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit Berin, Peter, I would like to draw your attention to TPCThreadManager.run as of revision 1.16. If my understanding of what is happening is correct, the only way a generic runtime exception can happen inside of the inner while loop is if m_threadManager.execute method throws one. ThreadPool doesn't have any contract regarding runtime exceptions, so we can presume that if m_threadPool threw one - it is a toast. Thus, we should not continue banging on it and the only thing TPCThreadManager.run can do is exit (possibly logging the exception, this is not in the patch below). On the other hand, PipelineRunner.run should catch RuntimeExceptions occurring inside EventHandler.handleEvents. That's why I moved the RuntimeExceptions catching code into PipelineRunner. Please see the attached patch. Thanks Greg --hSIA/mwzlm Content-Type: text/plain Content-Disposition: inline; filename="tpcthread-exception" Content-Transfer-Encoding: 7bit Index: TPCThreadManager.java =================================================================== RCS file: /home/cvspublic/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/command/TPCThreadManager.java,v retrieving revision 1.16 diff -c -r1.16 TPCThreadManager.java *** TPCThreadManager.java 24 May 2002 16:32:44 -0000 1.16 --- TPCThreadManager.java 28 May 2002 23:26:28 -0000 *************** *** 133,139 **** try { ! m_pipelines.put( pipeline, new PipelineRunner( pipeline ) ); if( m_done ) { --- 133,141 ---- try { ! PipelineRunner runner = new PipelineRunner( pipeline ); ! runner.enableLogging( getLogger() ); ! m_pipelines.put( pipeline, runner ); if( m_done ) { *************** *** 260,276 **** + "increase block-timeout or number of threads per processor", e ); } } - catch( RuntimeException e ) - { - //We want to catch this, because if an unexpected runtime exception comes through a single - //pipeline it can bring down the primary thread - - if( getLogger().isErrorEnabled() ) - { - getLogger().error( "Exception processing EventPipeline [msg: " + e.getMessage() + "]", - e ); - } - } } } finally --- 262,267 ---- *************** *** 287,293 **** } } ! public static final class PipelineRunner implements Runnable { private final EventPipeline m_pipeline; --- 278,286 ---- } } ! public static final class PipelineRunner ! extends AbstractLogEnabled ! implements Runnable { private final EventPipeline m_pipeline; *************** *** 303,309 **** for( int i = 0; i < sources.length; i++ ) { ! handler.handleEvents( sources[i].dequeueAll() ); } } } --- 296,317 ---- for( int i = 0; i < sources.length; i++ ) { ! try ! { ! handler.handleEvents( sources[i].dequeueAll() ); ! } ! catch( RuntimeException e ) ! { ! // We want to catch this, because this is the only ! // place where exceptions happening in this thread ! // can be logged ! ! if( getLogger().isErrorEnabled() ) ! { ! getLogger().error( "Exception processing EventPipeline [msg: " + e.getMessage() + "]", ! e ); ! } ! } } } } --hSIA/mwzlm Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: --hSIA/mwzlm--