ITS#9913 Protect code in clients_destroy and tier_destroy

This commit is contained in:
Ondřej Kuzník 2022-09-02 13:23:17 +01:00
parent 1942bc20a8
commit a033c1e74e
2 changed files with 5 additions and 0 deletions

View file

@ -796,8 +796,10 @@ client_destroy( LloadConnection *c )
void
clients_destroy( int gentle )
{
epoch_t epoch = epoch_join();
checked_lock( &clients_mutex );
connections_walk(
&clients_mutex, &clients, lload_connection_close, &gentle );
checked_unlock( &clients_mutex );
epoch_leave( epoch );
}

View file

@ -67,8 +67,11 @@ tier_destroy( LloadTier *tier )
{
while ( !LDAP_CIRCLEQ_EMPTY( &tier->t_backends ) ) {
LloadBackend *b = LDAP_CIRCLEQ_FIRST( &tier->t_backends );
epoch_t epoch = epoch_join();
lload_backend_destroy( b );
epoch_leave( epoch );
}
#ifdef BALANCER_MODULE