Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Running out of ephemeral ports with selenium server #923

Closed
lukeis opened this issue Mar 2, 2016 · 5 comments
Closed

Running out of ephemeral ports with selenium server #923

lukeis opened this issue Mar 2, 2016 · 5 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 923

What steps will reproduce the problem?
1. Running enough jobs between remote webdriver and seleium-server will cause the the
following message:

What is the expected output? What do you see instead?
Caused by: java.net.BindException: Address already in use: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(<unknown file>)
    at java.net.PlainSocketImpl.connectToAddress(<unknown file>)
    at java.net.PlainSocketImpl.connect(<unknown file>)
    at java.net.SocksSocketImpl.connect(<unknown file>)
    at java.net.Socket.connect(<unknown file>)
    at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:133)
    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:211)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:125)
    at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:340)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:336)
    at org.openqa.selenium.firefox.FirefoxDriver.execute(FirefoxDriver.java:233)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:186)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:55)

Please use labels and text to provide additional information.
The issue happens *real* quick on Windows XP, and can be improved by  http://support.microsoft.com/kb/196271
But even on a Linux box with over 30000 ephemeral we exhaust this.

The root-cause solution of this issue is to make keep-alives work between remote webdriver
and selenium server. There may also be a case for inspecting socket usage elesewhere
in the application.

Note that this issue *also* happens between the client and firefox, if run locally
or remotely. But this is slighlty less serious as it can be "mostly" solved by increasing
the number of ephemeral ports locally. But a single bamboo server can be used to drive
a truckload of clients, in which case 60000 sockets may be too little.

Reported by kristian.rosenvold on 2010-10-27 07:23:50

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Fixed in r10082, set the re-use option on the socket. Fixing keepalives would still
be nice for performance, but this fix should have impact for both client->firefox and
buildserver->selenium-server socket usage

Reported by kristian.rosenvold on 2010-10-28 11:00:15

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by kristian.rosenvold on 2010-10-28 14:20:05

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

This still appears to be a problem for me on Windows Windows
Server 2008 using 1.0b version of WebDriver. I am unclear if this fix is in 1.0b.

Reported by aaron%kahunacohen.com@gtempaccount.com on 2011-01-04 18:41:17

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Correction. I am running Selenium 2.0b

Reported by aaron%kahunacohen.com@gtempaccount.com on 2011-01-04 19:00:34

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 18:11:02

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 2, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant