Skip to content
Snippets Groups Projects
Commit e1536926 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

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

parent 9fc4a749
No related branches found
No related tags found
No related merge requests found
......@@ -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)) {
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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)) {
......
......@@ -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 */
......
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment