Skip to content
Snippets Groups Projects
Commit a1a63bea authored by Howard Chu's avatar Howard Chu
Browse files

ITS#4188 check for pool pause every 64 entries. (probably should make

this number tunable.)
parent 6715f737
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment