mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-02 20:10:11 -05:00
ITS#10327 Allow lockless config_back_search() during server pause
The assumption is that the only reason it is allowed to run at this point is that it is called from the reconfiguration context anyway.
This commit is contained in:
parent
fd0cf64b16
commit
ca5391b811
1 changed files with 10 additions and 2 deletions
|
|
@ -6994,10 +6994,17 @@ config_back_search( Operation *op, SlapReply *rs )
|
|||
CfBackInfo *cfb;
|
||||
CfEntryInfo *ce, *last = NULL;
|
||||
slap_mask_t mask;
|
||||
int paused = 0;
|
||||
|
||||
cfb = (CfBackInfo *)op->o_bd->be_private;
|
||||
|
||||
ldap_pvt_thread_rdwr_rlock( &cfb->cb_rwlock );
|
||||
if ( ldap_pvt_thread_pool_query( &connection_pool,
|
||||
LDAP_PVT_THREAD_POOL_PARAM_PAUSED, &paused ) ) {
|
||||
return -1;
|
||||
}
|
||||
if ( !paused ) {
|
||||
ldap_pvt_thread_rdwr_rlock( &cfb->cb_rwlock );
|
||||
}
|
||||
ce = config_find_base( cfb->cb_root, &op->o_req_ndn, &last, op );
|
||||
if ( !ce ) {
|
||||
if ( last )
|
||||
|
|
@ -7032,7 +7039,8 @@ config_back_search( Operation *op, SlapReply *rs )
|
|||
}
|
||||
|
||||
out:
|
||||
ldap_pvt_thread_rdwr_runlock( &cfb->cb_rwlock );
|
||||
if ( !paused )
|
||||
ldap_pvt_thread_rdwr_runlock( &cfb->cb_rwlock );
|
||||
send_ldap_result( op, rs );
|
||||
return rs->sr_err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue