Menu

#321 HTTPServiceCaller creates too many open sockets

2.2 (final)
closed-fixed
9
2009-09-14
2009-09-09
jborleffs
No

Each (CAPI) call that goes through the HTTPServiceCaller class creates a new socket that never gets closed. This way, file descriptors will not be available at some point, causing the call to fail.

A simple fix is to insert the following line below line 1058

client.getHttpConnectionManager().closeIdleConnections(0);

It would be great if this could be implemented in the second alpha release of 2.3, as it causes severe problems on our production platforms.

TIA.

Discussion

  • jborleffs

    jborleffs - 2009-09-09
    • priority: 5 --> 9
     
  • Anthony Goubard

    Anthony Goubard - 2009-09-10

    Ok, coming in release soon.

     
  • Anthony Goubard

    Anthony Goubard - 2009-09-10
    • assigned_to: nobody --> agoubard
    • status: open --> open-accepted
     
  • Anthony Goubard

    Anthony Goubard - 2009-09-14

    Fixed, will be in 2.3-alpha 3 coming this week.
    Note that it will probably be a temporary fix as XINS is likely to move to HttpClient 4.0 which includes better connection management and performance:
    http://www.theserverside.com/news/thread.tss?thread_id=55715

     
  • Anthony Goubard

    Anthony Goubard - 2009-09-14
    • status: open-accepted --> closed-fixed
     
  • jborleffs

    jborleffs - 2009-09-16

    The HTTPServiceCaller fix is not working as expected. The reason is that you implemented the following:

    client.getHttpConnectionManager().closeIdleConnections(0);
    method.releaseConnection();

    While I requested:

    method.releaseConnection();
    client.getHttpConnectionManager().closeIdleConnections(0);

    The difference is that in the first case, each call leaves an idle connection. In the second case, the connection becomes idle and the closeIdleConnections() call cleans it up.

     
  • Anthony Goubard

    Anthony Goubard - 2009-09-16

    I've put the code at the correct line and recreated the release.

     
  • jborleffs

    jborleffs - 2009-09-16

    Works like a charm now, thanks!

     

Log in to post a comment.

MongoDB Logo MongoDB