Bug #10341
Updated by François ARMAND over 7 years ago
Someone tried to run datasource plugin tests and they failed with errors like: <pre> 282/datasource/delay/node930 ; Error when getting data from datasource 'test-my-datasource' for node node59.localhost (node59): Error when fetching data from http://localhost:8282/datasource/delay/node59 ; Connection reset by peer java.net.SocketException: Connection reset by peer at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.net.NetworkClient.doConnect(NetworkClient.java:175) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) at sun.net.www.http.HttpClient.New(HttpClient.java:308) at sun.net.www.http.HttpClient.New(HttpClient.java:326) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933) at scalaj.http.DefaultConnectFunc$.apply(Http.scala:471) at scalaj.http.DefaultConnectFunc$.apply(Http.scala:469) at scalaj.http.HttpRequest.doConnection(Http.scala:355) at scalaj.http.HttpRequest.exec(Http.scala:335) at scalaj.http.HttpRequest.asString(Http.scala:455) at com.normation.rudder.datasources.QueryHttp$.$anonfun$QUERY$1(UpdateHttpDataset.scala:167) </pre> It very much looks like: http://stackoverflow.com/questions/22724334/connection-reset-by-peer-and-too-many-open-files-exceptions-wile-trying-to-s So it may be OSX specific, and trying that may help: <pre> sudo sysctl -w kern.maxfiles=1000200 sudo sysctl -w kern.maxfilesperproc=1000100 sudo ulimit -n 1000000 </pre> And add: <pre> limit maxfiles 1000100 2000200 </pre> </pre to /etc/launchd.conf and And add: <pre> kern.maxfiles=2000400 kern.maxfilesperproc=1000200 </pre> to /etc/sysctl.conf and restarting the computer, And launch tests with the following command: <pre> $ MAVEN_OPTS="-XX:-MaxFDLimit" mvn test </pre> Full stack in comment.