mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-23 23:33:07 -05:00
ITS#9878 We no longer have to trigger li->li_conn_expire_task twice
This commit is contained in:
parent
fa8cb31eb9
commit
3ad71958ee
1 changed files with 10 additions and 3 deletions
|
|
@ -3205,17 +3205,24 @@ ldap_back_schedule_conn_expiry( ldapinfo_t *li, ldapconn_t *lc ) {
|
|||
* timeout of this connection.
|
||||
*
|
||||
* If the task is already running, this connection cannot be next one
|
||||
* to expire and therefore timeout does not need to be re-calculated.
|
||||
* to expire (all connections share the same timeout) and therefore timeout
|
||||
* does not need to be re-calculated.
|
||||
*/
|
||||
ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
|
||||
if ( li->li_conn_expire_task == NULL ) {
|
||||
li->li_conn_expire_task = ldap_pvt_runqueue_insert( &slapd_rq,
|
||||
ldap_back_conn_expire_time( li, lc ) - slap_get_time(),
|
||||
li->li_conn_expire_task = ldap_pvt_runqueue_insert( &slapd_rq, 0,
|
||||
ldap_back_conn_expire_fn, li, "ldap_back_conn_expire_fn",
|
||||
"ldap_back_conn_expire_timer" );
|
||||
|
||||
li->li_conn_expire_task->interval.tv_sec =
|
||||
ldap_back_conn_expire_time( li, lc ) - slap_get_time();
|
||||
ldap_pvt_runqueue_resched( &slapd_rq, li->li_conn_expire_task, 0 );
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
"ldap_back_conn_prune: scheduled connection expiry timer to %ld sec\n",
|
||||
li->li_conn_expire_task->interval.tv_sec );
|
||||
|
||||
/* Make this a one-shot task */
|
||||
li->li_conn_expire_task->interval.tv_sec = 0;
|
||||
}
|
||||
ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue