Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 64643 invoked from network); 22 Oct 2007 17:10:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Oct 2007 17:10:09 -0000 Received: (qmail 57570 invoked by uid 500); 22 Oct 2007 17:09:52 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 57536 invoked by uid 500); 22 Oct 2007 17:09:52 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 57525 invoked by uid 99); 22 Oct 2007 17:09:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2007 10:09:52 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [217.71.112.101] (HELO sparus-exchange.ad.sparus.fr) (217.71.112.101) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2007 17:09:54 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C814CE.4FCE0227" Subject: Executing user code in Poller Thread for NIO connector on timeout (executor is specified in server.xml) Date: Mon, 22 Oct 2007 19:09:29 +0200 Message-ID: <405A8DA9BECB2940B758D3521DFCF6C02813A8@sparus-exchange.ad.sparus.fr> X-MS-Has-Attach: X-MS-TNEF-Correlator: thread-topic: Executing user code in Poller Thread for NIO connector on timeout (executor is specified in server.xml) Thread-Index: AcgUzk5I3Au3jQNhR8CP0n0IRZCpbQ== From: "Christophe Pierret" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C814CE.4FCE0227 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, I noticed that user code gets executed inside NIO Poller thread in case of timeout error, if the executor is specified in server.xml. Since there is very few poller threads, I guess it is not really a good idea that the user code run in case of timeouts is run within the Poller thread. =20 Here the call stack where it occurs for me (baseline 6.0.14). http-23-Poller-0@e9d daemon, priority=3D5, in group 'main', status: 'RUNNING' error():149, Halley.java event():68, Halley.java =3D>Implementation of CometProcessor.event() internalDoFilterEvent():470, ApplicationFilterChain.java doFilterEvent():363, ApplicationFilterChain.java event():422, StandardWrapperValve.java event():252, StandardContextValve.java event():179, StandardHostValve.java event():200, ValveBase.java event():128, StandardEngineValve.java event():175, CoyoteAdapter.java event():749, Http11NioProcessor.java event():637, Http11NioProtocol.java run():2009, NioEndpoint.java processSocket():1127, NioEndpoint.java cancelledKey():1377, NioEndpoint.java timeout():1611, NioEndpoint.java run():1452, NioEndpoint.java run():595, Thread.java =20 Do you think that this code could be executed within an "executor" thread instead ? =20 I think that the following lines (in cancelledKey(), NioEndpoint.java)may be changed from: processSocket(ka.getChannel(), status, false);//don't dispatch if the lines below are cancelling the key if (status =3D=3D SocketStatus.TIMEOUT ) return; // don't close on comet timeout =20 to: processSocket(ka.getChannel(), status, status =3D=3D SocketStatus.TIMEOUT);//don't dispatch if the lines below are cancelling the key if (status =3D=3D SocketStatus.TIMEOUT ) return; // don't close on comet timeout =20 =20 Best regards, Christophe Pierret ------_=_NextPart_001_01C814CE.4FCE0227--