HI Chris, luckily I got a Mac OS X box and the sample is already running ;-)
Cheers, Siegfried Goeschl ----- Ursprüngliche Mail ----- Von: "Chris Gamache" <[email protected]> An: "Commons Users List" <[email protected]> Gesendet: Dienstag, 26. Januar 2016 04:02:41 Betreff: Re: Help needed: commons-exec CLOSE_WAIT problem 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 < [email protected]> 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" <[email protected]> > An: [email protected] > 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: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
