mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Avoid deadlocks on reader txns
This commit is contained in:
parent
d7109e0f56
commit
e5b96f2c76
@ -1481,7 +1481,7 @@ bdb_reader_get( Operation *op, DB_ENV *env, DB_TXN **txn )
|
|||||||
|
|
||||||
if ( ldap_pvt_thread_pool_getkey( ctx, env, &data, NULL ) ) {
|
if ( ldap_pvt_thread_pool_getkey( ctx, env, &data, NULL ) ) {
|
||||||
for ( i=0, rc=1; rc != 0 && i<4; i++ ) {
|
for ( i=0, rc=1; rc != 0 && i<4; i++ ) {
|
||||||
rc = TXN_BEGIN( env, NULL, txn, DB_READ_COMMITTED );
|
rc = TXN_BEGIN( env, NULL, txn, DB_READ_COMMITTED | DB_TXN_NOWAIT );
|
||||||
if (rc) ldap_pvt_thread_yield();
|
if (rc) ldap_pvt_thread_yield();
|
||||||
}
|
}
|
||||||
if ( rc != 0) {
|
if ( rc != 0) {
|
||||||
|
@ -61,7 +61,7 @@ bdb_db_init( BackendDB *be, ConfigReply *cr )
|
|||||||
|
|
||||||
/* DBEnv parameters */
|
/* DBEnv parameters */
|
||||||
bdb->bi_dbenv_home = ch_strdup( SLAPD_DEFAULT_DB_DIR );
|
bdb->bi_dbenv_home = ch_strdup( SLAPD_DEFAULT_DB_DIR );
|
||||||
bdb->bi_dbenv_xflags = 0;
|
bdb->bi_dbenv_xflags = DB_TIME_NOTGRANTED;
|
||||||
bdb->bi_dbenv_mode = SLAPD_DEFAULT_DB_MODE;
|
bdb->bi_dbenv_mode = SLAPD_DEFAULT_DB_MODE;
|
||||||
|
|
||||||
bdb->bi_cache.c_maxsize = DEFAULT_CACHE_SIZE;
|
bdb->bi_cache.c_maxsize = DEFAULT_CACHE_SIZE;
|
||||||
@ -503,7 +503,7 @@ shm_retry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !quick ) {
|
if ( !quick ) {
|
||||||
TXN_BEGIN(bdb->bi_dbenv, NULL, &bdb->bi_cache.c_txn, DB_READ_COMMITTED);
|
TXN_BEGIN(bdb->bi_dbenv, NULL, &bdb->bi_cache.c_txn, DB_READ_COMMITTED | DB_TXN_NOWAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
entry_prealloc( bdb->bi_cache.c_maxsize );
|
entry_prealloc( bdb->bi_cache.c_maxsize );
|
||||||
|
Loading…
Reference in New Issue
Block a user