Skip to content

Commit

Permalink
load_balancer: open db connection from every process
Browse files Browse the repository at this point in the history
This ensures that the `mi("lb_reload")` command runs properly from
whatever process the job is dispatched from.

Many thanks to Antonis Psaras (@apsaras on GitHub) for reporting it.
Close #3488

(cherry picked from commit 3df04c7)
  • Loading branch information
razvancrainea committed Oct 17, 2024
1 parent bcbfaf8 commit ec2ccb8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/load_balancer/load_balancer.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,17 +479,17 @@ static int mod_init(void)

static int child_init(int rank)
{
/* init DB connection */
if ( lb_connect_db(&db_url)!=0 ) {
LM_CRIT("cannot initialize database connection\n");
return -1;
}
return 0;
}


static int mi_child_init( void )
{
/* init DB connection */
if ( lb_connect_db(&db_url)!=0 ) {
LM_CRIT("cannot initialize database connection\n");
return -1;
}
return 0;
}

Expand Down

0 comments on commit ec2ccb8

Please sign in to comment.