mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
syncrepl retry code fix for correct timing
This commit is contained in:
parent
b24e540790
commit
a1308f8dfa
@ -66,9 +66,9 @@ ldap_pvt_runqueue_remove(
|
||||
break;
|
||||
}
|
||||
|
||||
if ( e == entry ) {
|
||||
LDAP_STAILQ_REMOVE( &rq->task_list, entry, re_s, tnext );
|
||||
}
|
||||
assert( e == entry );
|
||||
|
||||
LDAP_STAILQ_REMOVE( &rq->task_list, entry, re_s, tnext );
|
||||
|
||||
LDAP_FREE( entry );
|
||||
}
|
||||
|
@ -2147,3 +2147,8 @@ void slapd_add_internal(ber_socket_t s, int isactive) {
|
||||
Listener ** slapd_get_listeners(void) {
|
||||
return slap_listeners;
|
||||
}
|
||||
|
||||
void slap_wake_listener()
|
||||
{
|
||||
WAKE_LISTENER(1);
|
||||
}
|
||||
|
@ -422,6 +422,7 @@ LDAP_SLAPD_F (void) slapd_remove LDAP_P((ber_socket_t s, int wasactive, int wake
|
||||
|
||||
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig));
|
||||
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig));
|
||||
LDAP_SLAPD_F (void) slap_wake_listener LDAP_P((void));
|
||||
|
||||
LDAP_SLAPD_F (void) slapd_set_write LDAP_P((ber_socket_t s, int wake));
|
||||
LDAP_SLAPD_F (void) slapd_clr_write LDAP_P((ber_socket_t s, int wake));
|
||||
|
@ -907,10 +907,11 @@ do_syncrepl(
|
||||
ldap_pvt_runqueue_stoptask( &syncrepl_rq, rtask );
|
||||
}
|
||||
|
||||
if ( dostop ) {
|
||||
connection_client_stop( s );
|
||||
}
|
||||
|
||||
if ( rc == LDAP_SUCCESS ) {
|
||||
if ( dostop ) {
|
||||
connection_client_stop( s );
|
||||
}
|
||||
if ( si->si_type == LDAP_SYNC_REFRESH_ONLY ) {
|
||||
defer = 0;
|
||||
}
|
||||
@ -929,15 +930,13 @@ do_syncrepl(
|
||||
}
|
||||
|
||||
if ( !si->si_retrynum || si->si_retrynum[i] == -2 ) {
|
||||
if ( dostop ) {
|
||||
connection_client_stop( s );
|
||||
}
|
||||
ldap_pvt_runqueue_remove( &syncrepl_rq, rtask );
|
||||
} else if ( si->si_retrynum[i] >= -1 ) {
|
||||
if ( si->si_retrynum[i] > 0 )
|
||||
si->si_retrynum[i]--;
|
||||
rtask->interval.tv_sec = si->si_retryinterval[i];
|
||||
ldap_pvt_runqueue_resched( &syncrepl_rq, rtask, 0 );
|
||||
slap_wake_listener();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user