]> git.sur5r.net Git - openldap/commitdiff
ITS#4188
authorQuanah Gibson-Mount <quanah@openldap.org>
Thu, 18 Oct 2007 02:39:22 +0000 (02:39 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 18 Oct 2007 02:39:22 +0000 (02:39 +0000)
CHANGES
include/ldap_pvt_thread.h
libraries/libldap_r/tpool.c
servers/slapd/result.c

diff --git a/CHANGES b/CHANGES
index 3d14d33ca299794e751472e6571988676eff77ed..c5df3185d02cc5dc51c27b90e5dc9a8bcc9b8471 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,7 @@ OpenLDAP 2.4.6 Engineering
        Fixed slapd X509 parsing (ITS#5070, #5151)
        Fixed slapd slap_passwd_parse (ITS#5159)
        Added slapd attribute value sorting (ITS#5153)
+       Added slapd checking for long-running tasks (ITS#4188)
        Fixed slapd syncrepl cookie propagation (ITS#5170)
        Fixed slapd-bdb/hdb suffix logging (ITS#5128)
        Fixed slapd-bdb/hdb IDL LRU handling (ITS#5121)
index 4d6a9d4294e1015ea5a7266eeeb8bea15be160bb..151756d692a03690537699f3e3f3ec709e6f1af6 100644 (file)
@@ -215,6 +215,7 @@ typedef enum {
        LDAP_PVT_THREAD_POOL_PARAM_OPEN,
        LDAP_PVT_THREAD_POOL_PARAM_STARTING,
        LDAP_PVT_THREAD_POOL_PARAM_ACTIVE,
+       LDAP_PVT_THREAD_POOL_PARAM_PAUSING,
        LDAP_PVT_THREAD_POOL_PARAM_PENDING,
        LDAP_PVT_THREAD_POOL_PARAM_BACKLOAD,
        LDAP_PVT_THREAD_POOL_PARAM_ACTIVE_MAX,
index fa1d2ae4628058114f9d3098b1319e40ad6c8259..6884f32fc3d4d1cb9900dc1981c60f421a823e9f 100644 (file)
@@ -397,6 +397,10 @@ ldap_pvt_thread_pool_query(
                count = pool->ltp_active_count;
                break;
 
+       case LDAP_PVT_THREAD_POOL_PARAM_PAUSING:
+               count = pool->ltp_pause;
+               break;
+
        case LDAP_PVT_THREAD_POOL_PARAM_PENDING:
                count = pool->ltp_pending_count;
                break;
index 4368bf8e4ae170eabfd2032827cf0b0908622185..c3e3861590b8ac4e02d05487795e89fe5939d0dd 100644 (file)
@@ -743,6 +743,13 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
                return LDAP_SIZELIMIT_EXCEEDED;
        }
 
+       /* Every 64 entries, check for thread pool pause */
+       if (( rs->sr_nentries & 0x3f == 0x3f ) &&
+               ldap_pvt_thread_pool_query( &connection_pool,
+                       LDAP_PVT_THREAD_POOL_PARAM_PAUSING, &i ) == 0 && i ) {
+               return LDAP_BUSY;
+       }
+
        rs->sr_type = REP_SEARCH;
 
        /* eventually will loop through generated operational attribute types