Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.4.1
-
Fix Version/s: 1.4.1
-
Component/s: None
-
Labels:None
-
Complexity:Intermediate
-
Number of attachments :
Description
If you generate a lot of requests using the XMLRPC layer, such as when distributed builds are active, it is possible for connections to stay in the CLOSE_WAIT state until they are garbage collected. On a busy server with the default file limits, this can result in a IOException: Too many open files error.
The workaround is to increase the limit of the files for the user running Continuum. However, the XMLRPC layer should manage the connections better to avoid them getting into this state.
I traced this into the way the XMLRPC is set up.
Atlassian XMLRPC Binder sets up Apache XMLRPC Client using the Commons HTTP Client 3.1 transport. HTTP Client is using the default SimpleHttpConnectionManager. These are all hard coded.
Because the binder is not reused, a new XMLRPC client is set up for each call. The XMLRPC client calls releaseConnection on the HTTP Client, which leaves the physical connection open for reuse - but with nothing set up to reuse it or terminate it, it is left open until GC happens on the socket. This is often quick, but some connections make it into the more permanent area of heap.
See: http://fuyun.org/2009/09/connection-close-in-httpclient/
Medium term, the XMLRPC should be replaced with JAX-RS.
Potential short term solutions:
This needs further investigation.