From: Ondřej Kuzník Date: Thu, 18 Oct 2018 14:49:43 +0000 (+0100) Subject: Shorten to one epoch per PDU X-Git-Tag: OPENLDAP_REL_ENG_2_5_1ALPHA~18^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2e57148fac2068bd2ee674d94ddd3d2cba22986;p=thirdparty%2Fopenldap.git Shorten to one epoch per PDU A full read cycle can take a very long time if the limits are set too high. --- diff --git a/servers/lloadd/connection.c b/servers/lloadd/connection.c index e1b4c39019..886a2b6a83 100644 --- a/servers/lloadd/connection.c +++ b/servers/lloadd/connection.c @@ -128,6 +128,11 @@ handle_pdus( void *ctx, void *arg ) } break; } + + assert( IS_ALIVE( c, c_refcnt ) ); + epoch_leave( epoch ); + epoch = epoch_join(); + assert( IS_ALIVE( c, c_refcnt ) ); } event_add( c->c_read_event, c->c_read_timeout ); diff --git a/servers/lloadd/epoch.h b/servers/lloadd/epoch.h index b5ae045008..89f0bc4b26 100644 --- a/servers/lloadd/epoch.h +++ b/servers/lloadd/epoch.h @@ -132,6 +132,7 @@ int try_release_ref( uintptr_t *refp, void *object, dispose_cb *cb ); */ #define RELEASE_REF( object, ref_field, cb ) \ do { \ + assert( IS_ALIVE( (object), ref_field ) ); \ if ( !__atomic_sub_fetch( \ &(object)->ref_field, 1, __ATOMIC_ACQ_REL ) ) { \ epoch_append( object, (dispose_cb *)cb ); \