]> git.sur5r.net Git - openldap/commitdiff
Quick check of LOCK_ID() return. Likely should retry... but not forever.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 20 Aug 2002 03:10:08 +0000 (03:10 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 20 Aug 2002 03:10:08 +0000 (03:10 +0000)
servers/slapd/back-bdb/attribute.c
servers/slapd/back-bdb/bind.c
servers/slapd/back-bdb/compare.c
servers/slapd/back-bdb/group.c
servers/slapd/back-bdb/referral.c
servers/slapd/back-bdb/search.c

index 00a16b0ee0a3b1670b6cfc094e502915ba77f38e..6ad4b30e78d0a21f3d3eae9de98f2a231e59107a 100644 (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)) {
index b9c44d0e948dd680d3e74acec22b36746c649439..7a9230dcdc355291fae7a7323585a3396a5a6e49 100644 (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 */
index 5b73810ddc6deb459b0b54181bcaee492505df8c..c22c4311c71c269796052f3e6c959e9829559140 100644 (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 */
index 1d75d60202aa7caeb2742e18c1474f0dbceaea59..d4fb4de09e0bdc23912ab7de3faaf56a2e21600c 100644 (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)) {
index 279e7a04eee0c4db09e80337af4ec90ce424925b..1ecbf1dddce1b3c1f16c867836c8e67adf61914c 100644 (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 */
index b5961125563197d2097697e3dd246b0fa9b11fe7..a7b07367195079ad7ae16eb03848c32dbb2b6052 100644 (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 */