Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 89600D5BA for ; Fri, 29 Jun 2012 09:22:55 +0000 (UTC) Received: (qmail 78725 invoked by uid 500); 29 Jun 2012 09:22:51 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 78460 invoked by uid 500); 29 Jun 2012 09:22:48 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 77839 invoked by uid 99); 29 Jun 2012 09:22:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jun 2012 09:22:42 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.145.109.33] (HELO mx3-v2.alinto.net) (83.145.109.33) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jun 2012 09:22:36 +0000 X-Virus-Scanned: amavisd-new at alinto.net Received: from [192.168.2.45] (LDijon-156-66-21-52.w80-11.abo.wanadoo.fr [80.11.48.52]) (Authenticated sender: lpetit@yseop.com) by mx3-v2.alinto.net (Postfix) with ESMTPA id 34C04742BC; Fri, 29 Jun 2012 11:22:08 +0200 (CEST) Message-ID: <1340961729.13251.26.camel@localhost> Subject: Re: Re : Re: Issue with keep-alive connections, when using APR Connector on Windows and starting Processes from Servlets From: Laurent Petit To: "verlag.preisser@t-online.de" Cc: Tomcat Users List Date: Fri, 29 Jun 2012 11:22:09 +0200 In-Reply-To: <1SjEOU-1oXOyW0@fwd00.aul.t-online.de> References: <1SjEOU-1oXOyW0@fwd00.aul.t-online.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.1- Content-Transfer-Encoding: 8bit Mime-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hello Jeff, Konstantin & all, On Mon, 2012-06-25 at 20:52 +0200, verlag.preisser@t-online.de wrote: > Hello Jeff & all, > > > Von: Jeff MAURY > > Datum: Mon, 25 Jun 2012 18:46:02 +0200 > > > Konstantin, > > > > your explanations are very interesting but unclear to me: what do you > > call the inactivity timer ? When it is started ? After the request has > > been processed by the servlet ? In that case, I see no difference > > between a servlet that launch a process and another one. > > It seems to me that a process that is launched does not inhererits > > handles from its parent process but it's possible that under Windows, > > it's an option so it would be interesting to watch. > > > > Jeff > > > > Sorry, I'm just a normal Tomcat user, and I don't know how exactly the APR connector and its Timeout works, so I am unable to answer that. > > > Howewer, I did some further observations: > > -When I perform a request to the servlet that opens wordpad.exe, the TCP connection from Tomcat does not close after the timeout - even when I kill the Tomcat process (java.exe), the TCP connection is still open. If I kill wordpad.exe, then finally the connection is closed/aborted. > -When I have 1 TCP connection open to Tomcat and the servlet starts the little C program, Task manager shows that it has 11 handles. > However, when I have 5 TCP connections open to Tomcat, and do the request on one of them, Task maanger shows that the C program has 15 handles - so four more handles when there are four more connections to Tomcat. All of that 5 TCP connections don't close until I kill that process. > > That seems to me to be an indication that socket handles could be inherited by the child processes that are startet by ProcessBuilder from tomcat. > > A msdn article mentions how to create a new process using CreateProcess(); it also mentions that socket handles can be inherited: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724466.aspx > > However, as I don't have much knowledge about programming with WinAPIs, I don't know why those handles are inherited (the MSDN article mentions that a handle must be specified as inheritable when created, to allow a child process to inherit it). Maybe someone with more WinAPI/Tomcat Native knowledge can help here. I also had the vague intuition that this related to handles inheritence. Your recent tests & research tend to make this hypothesis even more appealing. I know nothing about tomcat-native implementation, but I was able to see that the bInheritHandle member is set to true here in tomcat native's C code: lpetit:~/tmp/tomcat-native $ grep "bInheritHandle" -R * native/os/win32/ntpipe.c: con->sa.bInheritHandle = TRUE; ( http://svn.apache.org/repos/asf/tomcat/native/branches/1.1.x/native/os/win32/ntpipe.c ) Jeff, What else could we do to help investigate / fix this issue ? Cheers, -- Laurent > > Regards, > Konstantin Preißer > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > -- Laurent Petit Agence +33 (0)4 78 47 07 49 Email lpetit@yseop.com Yseop apporte une réponse intelligente et individualisée à chacun de vos clients www.yseop.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org