From: Howard Chu Date: Thu, 20 Mar 2003 12:40:11 +0000 (+0000) Subject: ITS#2389 - stop reading requests on a conn if it has more than X-Git-Tag: NO_SLAP_OP_BLOCKS~78 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a63b8908cd7f16110496a8fb2859572f86cbf71f;p=openldap ITS#2389 - stop reading requests on a conn if it has more than connection_pool_max/2 operations already executing. May want to tune this to a higher value, e.g. connection_pool_max - XX, etc. Fix in result.c throttles the connection too late, all threads are already consumed by the time the send buffer blocks. --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 005496fdd9..3dcadbc58b 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1493,6 +1493,15 @@ connection_input( } else { conn->c_n_ops_executing++; + /* Don't allow any single conn to soak up all of the + * available threads + */ + if (conn->c_n_ops_executing > connection_pool_max/2) { + ber_socket_t sd; + + ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_GET_FD, &sd ); + slapd_clr_read( sd, 0 ); + } connection_op_activate( conn, op ); }