mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-28 10:39:34 -05:00
ITS#7165 back-mdb: check for stale readers on MDB_READERS_FULL
retry opening a read txn if we cleared any stale readers
This commit is contained in:
parent
26e3721359
commit
205e2f1a3e
1 changed files with 10 additions and 0 deletions
|
|
@ -779,7 +779,17 @@ mdb_opinfo_get( Operation *op, struct mdb_info *mdb, int rdonly, mdb_op_info **m
|
|||
return rc;
|
||||
}
|
||||
if ( ldap_pvt_thread_pool_getkey( ctx, mdb->mi_dbenv, &data, NULL ) ) {
|
||||
int retried = 0;
|
||||
retry:
|
||||
rc = mdb_txn_begin( mdb->mi_dbenv, NULL, MDB_RDONLY, &moi->moi_txn );
|
||||
if (rc == MDB_READERS_FULL && !retried) {
|
||||
int dead;
|
||||
/* if any stale readers were cleared, a slot should be available */
|
||||
if (!mdb_reader_check( mdb->mi_dbenv, &dead ) && dead) {
|
||||
retried = 1;
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
if (rc) {
|
||||
Debug( LDAP_DEBUG_ANY, "mdb_opinfo_get: err %s(%d)\n",
|
||||
mdb_strerror(rc), rc );
|
||||
|
|
|
|||
Loading…
Reference in a new issue