Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2809518C39 for ; Tue, 26 Jan 2016 03:02:54 +0000 (UTC) Received: (qmail 52239 invoked by uid 500); 26 Jan 2016 03:02:53 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 52107 invoked by uid 500); 26 Jan 2016 03:02:53 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 52095 invoked by uid 99); 26 Jan 2016 03:02:52 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jan 2016 03:02:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 573AB1A0378 for ; Tue, 26 Jan 2016 03:02:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Dfb--yaExFdu for ; Tue, 26 Jan 2016 03:02:44 +0000 (UTC) Received: from mail-qg0-f45.google.com (mail-qg0-f45.google.com [209.85.192.45]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 28F93210B2 for ; Tue, 26 Jan 2016 03:02:43 +0000 (UTC) Received: by mail-qg0-f45.google.com with SMTP id e32so125850230qgf.3 for ; Mon, 25 Jan 2016 19:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ixic53kjut5NXecZH4fhE0ZrMjjbpCGh7KQub7L/yfc=; b=z86Tpabh/5HtrK62i3ivx6BMTBRr4443NjcHdH+pzqJpjWJee/zpApJTQVwJcCnglV AdMXG/M8ncTlhGVIEEQfJ9LY0qb1XdijZdEApZtZgSSZ3Yiu0gQL2njf8/oTpKrrMMB8 poPmrmQsNG/W76QmyPRSQcZwJnTFy0d12HjLlOlhSQ3+VbaTGUcaWaOszwQkQbp3uDNv D9D5OsqvDKpQfj94tV3zNOs4TdG3G+9N0jQheTaxr4sL0wbyDSsNwpaP0Fbwt0pCG73b biSBLG2IRDMFELR+9353hYkQnYUA8WiiI8B9iO9ldipTOpFaj73Vocc/vFVj8E3InHTj jHXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=ixic53kjut5NXecZH4fhE0ZrMjjbpCGh7KQub7L/yfc=; b=CRqff/yzzFKc5WrZVTJ/PQhShafUHvj/ItuduuUrGTE1IM3w4pmEIqKXtnxujFM5XB LVzOXiH3voGfbknnxpIVgFj7eVPzvMAYqCBWpS9rsvg9w/IT3l5LeKRA20m2TsWNl6qj QZXUSCYuBQkJ00z5lKAgfKiapThUgcREuSPfqy4g1u3C+1P4WMZ1XXVAxfVx2xDt4zY8 t+PGre5Wiw43trtYVb23HKabe0iJmuktuce1WlklMdTzQA2C5NA2QkRsJmT5rhNEyaAg 0EHpVSg4bITZ3unL++Efk2P/HHANZQCVrpfaD0sxC8U9LeP2Rbnct+EaDwioUIbMmyaW xg/w== X-Gm-Message-State: AG10YOSwrfuAy/8iVwBr2FFdeNc9Kj3xEhuqZIIB0KNGDMCU07qSk3vP/C8f2cSeq2SB+RpkU3e4F9uV2qeOeA== MIME-Version: 1.0 X-Received: by 10.140.173.132 with SMTP id t126mr26817335qht.96.1453777362036; Mon, 25 Jan 2016 19:02:42 -0800 (PST) Received: by 10.55.136.68 with HTTP; Mon, 25 Jan 2016 19:02:41 -0800 (PST) In-Reply-To: <41964619.849522.1453760894011.JavaMail.root@it20one.com> References: <41964619.849522.1453760894011.JavaMail.root@it20one.com> Date: Mon, 25 Jan 2016 22:02:41 -0500 Message-ID: Subject: Re: Help needed: commons-exec CLOSE_WAIT problem From: Chris Gamache To: Commons Users List Content-Type: multipart/alternative; boundary=001a1139c33c3f3022052a33eb83 --001a1139c33c3f3022052a33eb83 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Most defnintely. This was tested on OSX, but should work properly on Linux also. You'll need to install phantomjs. You can clone this repo (https://github.com/cgamache/openfile) and build with Maven. The com.codeborne:phantomjsdriver artifact has all of selenium packaged inside. To run, $ java -jar openfile.jar /path/to/phantomjs To examine, $ lsof -p 38270 | grep CLOSE_WAIT | wc -l Jan 25, 2016 9:46:17 PM org.openqa.selenium.phantomjs.PhantomJSDriverService ....... super chatty........ [INFO - 2016-01-26T02:46:41.169Z] ShutdownReqHand - _handle - About to shutdown Sleeping for 30 seconds so you can examine file handles... you should see 5 Then you can use the lsof command at the top of the output, complete with process ID, to check the CLOSE_WAIT file handles. Thanks for taking a look! CG On Mon, Jan 25, 2016 at 5:28 PM, Siegfried G=C3=B6schl < siegfried.goeschl@it20one.com> wrote: > Hi Chris, > > there could be couple of reasons for this behaviour - is there a minimal > setup to reproduce the problem? > > Thanks in advance > > Siegfried Goeschl > > ----- Urspr=C3=BCngliche Mail ----- > Von: "Chris Gamache" > An: user@commons.apache.org > Gesendet: Montag, 25. Januar 2016 22:34:34 > Betreff: Help needed: commons-exec CLOSE_WAIT problem > > Hi commons-exec folks, > > Hoping you can help me figure this out. Selenium Java uses commons-exec 1= .3 > under the hood to communicate with phantomjs. When it fires up it opens u= p > a pipe that you can see with lsof: > > # lsof -p 19947 > > ... > java 19947 user 64 PIPE 0xd2cd00ccca85f9d 16384 > ->0xd2cd00ca9fbbf9d > java 19947 user 66 PIPE 0xd2cd00ca31d445d 16384 > ->0xd2cd00ca31d4c9d > > Then we get this in lsof as selenium is driving phantomjs: > > java 19947 user 62u IPv6 0xd2cd00cc904879d 0t0 TCP > localhost:49757->localhost:23795 (ESTABLISHED) > > Then after selenium closes and terminates the executor-- properly, as I > observed by stepping through the code as it executes, but maybe someone > knows otherwise-- we can see in lsof: > > java 19947 user 62u IPv6 0xd2cd00cc904879d 0t0 TCP > localhost:49757->localhost:23795 (CLOSE_WAIT) > > And each successive web driver instance that gets created cause those to > build up and build up and build up until you run out of file handles. > > ... So are there any considerations for using commons-exec that the > selenium folks might not be addressing during process destruction which > might manifest themselves in these file handles just hanging out, taking = up > space? This can't be the correct/uncorrectable behavior. > > I happen to be using Selenium Java 2.49.1 which is the latest version as = of > this moment, and Java 8. It seems like this has been broken for quite som= e > time though -- https://github.com/SeleniumHQ/selenium/issues/1080 > > Please advise! Thanks! > > CG > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --001a1139c33c3f3022052a33eb83--