commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Gamache <cgama...@gmail.com>
Subject Re: Help needed: commons-exec CLOSE_WAIT problem
Date Tue, 26 Jan 2016 03:02:41 GMT
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 <init>

....... 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öschl <
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√ľngliche Mail -----
> Von: "Chris Gamache" <cgamache@gmail.com>
> 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 up
> 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 some
> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message