Join GitHub today
I'm using Selenium Java 2.47.1 and Firefox 39.0 on Windows.
While crawling my website, i do a lot of "findElement" and other commands with Selenium.
After plenty commands, i have this kind of error :
According to my netstat, i got around 16350 connections in TIME_WAIT state :
Running the windows command to get dynamics port range :
A simple way to reproduce it (with a fast enough computer, it stops around 16384 on windows...) :
It seems that i don't have any Dynamic port available to establish a new connection... and i think the problem will be the same with Linux (TIME_WAIT is usualy 60s).
Of course, i can increase the dynamic ports count, but it'll not solve my problem (because i can't get more than 65535 ports).
So my question : is there a way or a parameter to reduce the connections count (persistent connections ?) or the TIME_WAIT connection count ?
After some investigation, Selenium uses Apache HttpClient wich support persistent connections.
But for firefox, httpd.js (the Firefox Httpd server for unit tests) doesn't support it...
@krosenvold we do have our own internal copy of httpd.js that you could patch :)
Although not sure if it'll matter much in the long run. Firefox is soon going to require extension signing by AMO and Mozilla has now said they have no intention of signing our extension. This leaves us with only being able to use marionette for future versions.