Ticket #1589: 0001-Remove-connection-limit-based-on-FD_SETSIZE.patch

File 0001-Remove-connection-limit-based-on-FD_SETSIZE.patch, 1.9 KB (added by sckobras, 3 years ago)
  • source/libs/comm/cl_commlib.c

    From e3bed7dbcbf633a6a05a4d271e81ae6630dc2697 Mon Sep 17 00:00:00 2001
    From: Daniel Kobras <d.kobras@science-computing.de>
    Date: Wed, 16 Nov 2016 15:30:52 +0100
    Subject: [PATCH] Remove connection limit based on FD_SETSIZE
    
    Changeset 4739 (20140406123948-0ed77-974278d41c87f2f53e735ad9d271fc2c211d3395)
    unconditionally instated poll()-based connection handling, but erroneously
    reactivated two checks that were supposed to be used with select() only. Thus,
    the number of simultaneous qmaster connections was capped by FD_SETSIZE, and
    would typically cause trouble with 1000 or more hosts.
    
    Signed-off-by: Daniel Kobras <d.kobras@science-computing.de>
    ---
     source/libs/comm/cl_commlib.c | 12 +-----------
     1 file changed, 1 insertion(+), 11 deletions(-)
    
    diff --git a/source/libs/comm/cl_commlib.c b/source/libs/comm/cl_commlib.c
    index ff78c6a..8f6c3b2 100644
    a b char* cl_com_get_unresolvable_hosts(void) { 
    667667#define __CL_FUNCTION__ "cl_com_is_valid_fd()"
    668668bool cl_com_is_valid_fd (int fd) {
    669669
    670    if (fd >= 0){
    671       if(fd >= FD_SETSIZE){
    672          CL_LOG_INT(CL_LOG_WARNING, "filedescriptor is >= FD_SETSIZE: ", fd);
    673          return false;
    674       }
    675    } else {
     670   if (fd < 0) {
    676671      CL_LOG_INT(CL_LOG_WARNING, "filedescriptor is < 0: ", fd);
    677672      return false;
    678673   }
    cl_com_handle_t* cl_com_create_handle(int* commlib_error, 
    12711266
    12721267   new_handle->max_open_connections = (unsigned long) application_rlimits.rlim_cur;
    12731268
    1274    if (FD_SETSIZE < new_handle->max_open_connections) {
    1275       CL_LOG(CL_LOG_ERROR,"FD_SETSIZE < file descriptor limit");
    1276       new_handle->max_open_connections = FD_SETSIZE - 1;
    1277    }
    1278 
    12791269   if ( new_handle->max_open_connections < 32 ) {
    12801270      CL_LOG_INT(CL_LOG_ERROR, "to less file descriptors:", (int)new_handle->max_open_connections );
    12811271      sge_free(&new_handle);