Also related, cancel any ops on a DB that is being deleted.
return rc;
}
+#define PAUSEPOLL 100
+
int
mdb_search( Operation *op, SlapReply *rs )
{
int manageDSAit;
int tentries = 0;
int admincheck = 0;
+ int pausepoll;
IdScopes isc;
MDB_cursor *mci, *mcd;
ww_ctx wwctx;
id = mdb_idl_first( candidates, &cursor );
}
+ pausepoll = 0;
while (id != NOID)
{
int scopeok;
loop_begin:
+ if ( ++pausepoll == PAUSEPOLL ) {
+ pausepoll = 0;
+ if ( ldap_pvt_thread_pool_pausing( &connection_pool ) > 0 )
+ ldap_pvt_thread_pool_pausewait( &connection_pool );
+ }
+
/* check for abandon */
if ( op->o_abandon ) {
rs->sr_err = SLAPD_ABANDON;
if ( ce->ce_be->bd_info->bi_db_close ) {
ce->ce_be->bd_info->bi_db_close( ce->ce_be, NULL );
}
+ connections_drop_db( ce->ce_be );
backend_destroy_one( ce->ce_be, 1);
}
connection_done( c );
}
+/* Drop all ops for given database */
+void connections_drop_db( BackendDB *be )
+{
+ Operation *o;
+ Connection* c;
+ ber_socket_t connindex;
+ BackendDB *rbe = be->bd_self;
+
+ for( c = connection_first( &connindex );
+ c != NULL;
+ c = connection_next( c, &connindex ) )
+ {
+ for ( o = LDAP_STAILQ_FIRST( &c->c_ops ); o; o = LDAP_STAILQ_NEXT( o, o_next )) {
+ if ( o->o_bd && o->o_bd->bd_self == rbe ) {
+ o->o_abandon = 1;
+ o->o_cancel = 1;
+ }
+ }
+ }
+ connection_done( c );
+}
+
static Connection* connection_get( ber_socket_t s )
{
Connection *c;
LDAP_SLAPD_F (int) connections_destroy LDAP_P((void));
LDAP_SLAPD_F (int) connections_timeout_idle LDAP_P((time_t));
LDAP_SLAPD_F (void) connections_drop LDAP_P((void));
+LDAP_SLAPD_F (void) connections_drop_db LDAP_P(( BackendDB *be ));
LDAP_SLAPD_F (Connection *) connection_client_setup LDAP_P((
ber_socket_t s,