ITS#9555 Introduce a default operations timeout for back-asyncmeta

This commit is contained in:
Nadezhda Ivanova 2021-05-18 16:41:08 +03:00 committed by Quanah Gibson-Mount
parent 4005c53d89
commit 915e515970
4 changed files with 10 additions and 2 deletions

View File

@ -446,6 +446,8 @@ Operations can be
\fB<op> ::= bind, add, delete, modrdn, modify, compare, search\fP
By default, the timeout for all operations is 2 seconds.
See
.B slapd\-meta(5)
for details.

View File

@ -326,8 +326,10 @@ typedef struct a_metatarget_t {
#define META_BACK_TGT_NOREFS(mt) META_BACK_TGT_ISSET( (mt), LDAP_BACK_F_NOREFS )
#define META_BACK_TGT_NOUNDEFFILTER(mt) META_BACK_TGT_ISSET( (mt), LDAP_BACK_F_NOUNDEFFILTER )
#define META_BACK_CFG_MAX_PENDING_OPS 0x80
#define META_BACK_CFG_MAX_PENDING_OPS 0x80
#define META_BACK_CFG_MAX_TARGET_CONNS 0xFF
#define META_BACK_CFG_DEFAULT_OPS_TIMEOUT 0x02
/* the interval of the timeout checking loop in microseconds
* possibly make this configurable? */
#define META_BACK_CFG_MAX_TIMEOUT_LOOP 0x70000

View File

@ -1177,7 +1177,7 @@ asyncmeta_back_cf_gen( ConfigArgs *c )
case LDAP_BACK_CFG_TIMEOUT:
for ( i = 0; i < SLAP_OP_LAST; i++ ) {
if ( mc->mc_timeout[ i ] != 0 ) {
if ( mc->mc_timeout[ i ] != META_BACK_CFG_DEFAULT_OPS_TIMEOUT ) {
break;
}
}

View File

@ -149,6 +149,10 @@ asyncmeta_back_db_init(
mi->mi_nretries = META_RETRY_DEFAULT;
mi->mi_version = LDAP_VERSION3;
for ( i = 0; i < SLAP_OP_LAST; i++ ) {
mi->mi_timeout[ i ] = META_BACK_CFG_DEFAULT_OPS_TIMEOUT;
}
for ( i = LDAP_BACK_PCONN_FIRST; i < LDAP_BACK_PCONN_LAST; i++ ) {
mi->mi_conn_priv[ i ].mic_num = 0;
LDAP_TAILQ_INIT( &mi->mi_conn_priv[ i ].mic_priv );