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) { |
667 | 667 | #define __CL_FUNCTION__ "cl_com_is_valid_fd()" |
668 | 668 | bool cl_com_is_valid_fd (int fd) { |
669 | 669 | |
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) { |
676 | 671 | CL_LOG_INT(CL_LOG_WARNING, "filedescriptor is < 0: ", fd); |
677 | 672 | return false; |
678 | 673 | } |
… |
… |
cl_com_handle_t* cl_com_create_handle(int* commlib_error, |
1271 | 1266 | |
1272 | 1267 | new_handle->max_open_connections = (unsigned long) application_rlimits.rlim_cur; |
1273 | 1268 | |
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 | | |
1279 | 1269 | if ( new_handle->max_open_connections < 32 ) { |
1280 | 1270 | CL_LOG_INT(CL_LOG_ERROR, "to less file descriptors:", (int)new_handle->max_open_connections ); |
1281 | 1271 | sge_free(&new_handle); |