Project

General

Profile

Actions

Bug #10341

closed

Running datasources test fails on some machine

Added by François ARMAND over 7 years ago. Updated about 6 years ago.

Status:
Released
Priority:
N/A
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Fix check:
Regression:

Description

Someone tried to run datasource plugin tests and they failed with errors like:

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)

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:

sudo sysctl -w kern.maxfiles=1000200
sudo sysctl -w kern.maxfilesperproc=1000100
sudo ulimit -n 1000000

And add:

limit maxfiles 1000100 2000200

to /etc/launchd.conf and

And add:

kern.maxfiles=2000400
kern.maxfilesperproc=1000200

to /etc/sysctl.conf and restarting the computer,

And launch tests with the following command:

$ MAVEN_OPTS="-XX:-MaxFDLimit" mvn test

Full stack in comment.


Related issues 1 (0 open1 closed)

Related to Datasources - Bug #10348: Datasource test server port is not randomReleasedVincent MEMBRÉActions
Actions

Also available in: Atom PDF