Quick check of LOCK_ID() return. Likely should retry... but not forever.

This commit is contained in:
Kurt Zeilenga 2002-08-20 03:10:08 +00:00
parent 9fc4a749dc
commit e1536926b7
6 changed files with 47 additions and 11 deletions

View File

@ -70,8 +70,13 @@ bdb_attribute(
if ( txn != NULL ) {
locker = TXN_ID ( txn );
} else {
/* XXYYZ: need to check return value */
LOCK_ID ( bdb->bi_dbenv, &locker );
rc = LOCK_ID ( bdb->bi_dbenv, &locker );
switch(rc) {
case 0:
break;
default:
return LDAP_OTHER;
}
}
if (target != NULL && dn_match(&target->e_nname, entry_ndn)) {

View File

@ -49,8 +49,15 @@ bdb_bind(
Debug( LDAP_DEBUG_ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val, 0, 0);
#endif
/* XXYYZ: need to check return value */
LOCK_ID(bdb->bi_dbenv, &locker);
rc = LOCK_ID(bdb->bi_dbenv, &locker);
switch(rc) {
case 0:
break;
default:
send_ldap_result( conn, op, rc=LDAP_OTHER,
NULL, "internal error", NULL, NULL );
return rc;
}
dn2entry_retry:
/* get entry */

View File

@ -34,8 +34,15 @@ bdb_compare(
u_int32_t locker;
DB_LOCK lock;
/* XXYYZ: need to check return value */
LOCK_ID ( bdb->bi_dbenv, &locker );
rc = LOCK_ID(bdb->bi_dbenv, &locker);
switch(rc) {
case 0:
break;
default:
send_ldap_result( conn, op, rc=LDAP_OTHER,
NULL, "internal error", NULL, NULL );
return rc;
}
dn2entry_retry:
/* get entry */

View File

@ -82,8 +82,13 @@ bdb_group(
if ( txn ) {
locker = TXN_ID( txn );
} else {
/* XXYYZ: need to check return value */
LOCK_ID ( bdb->bi_dbenv, &locker );
switch(rc) {
case 0:
break;
default:
return 1;
}
}
if (dn_match(&target->e_name, gr_ndn)) {

View File

@ -39,8 +39,13 @@ bdb_referrals(
return rc;
}
/* XXYYZ: need to check return value */
LOCK_ID ( bdb->bi_dbenv, &locker );
rc = LOCK_ID(bdb->bi_dbenv, &locker);
switch(rc) {
case 0:
break;
default:
return LDAP_OTHER;
}
dn2entry_retry:
/* get entry */

View File

@ -71,8 +71,15 @@ bdb_search(
manageDSAit = get_manageDSAit( op );
/* XXYYZ: need to check return value */
LOCK_ID (bdb->bi_dbenv, &locker );
rc = LOCK_ID (bdb->bi_dbenv, &locker );
switch(rc) {
case 0:
break;
default:
send_ldap_result( conn, op, rc=LDAP_OTHER,
NULL, "internal error", NULL, NULL );
return rc;
}
if ( nbase->bv_len == 0 ) {
/* DIT root special case */