Skip to content

Commit

Permalink
[load_balancer & dispatcher] FS stats do not depend on probing
Browse files Browse the repository at this point in the history
Enabling the stats collection (via timer) from FS boxes must not be conditioned by the activation of probing - there is not relation / dependency between the two.
Closes #3216
Reported by @spacetourist
  • Loading branch information
bogdan-iancu committed Oct 10, 2023
1 parent 47f56e0 commit 14df284
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
15 changes: 8 additions & 7 deletions modules/dispatcher/dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,13 +1022,14 @@ static int mod_init(void)
return -1;
}

/* Register the weight-recalculation timer */
if (fetch_freeswitch_stats &&
register_timer("ds-update-weights", ds_update_weights, NULL,
fs_api.stats_update_interval, TIMER_FLAG_SKIP_ON_DELAY)<0) {
LM_ERR("failed to register timer for weight recalc!\n");
return -1;
}
}

/* Register the weight-recalculation timer */
if (fetch_freeswitch_stats &&
register_timer("ds-update-weights", ds_update_weights, NULL,
fs_api.stats_update_interval, TIMER_FLAG_SKIP_ON_DELAY)<0) {
LM_ERR("failed to register timer for weight recalc!\n");
return -1;
}

/* register timer to flush the state of destination back to DB */
Expand Down
16 changes: 8 additions & 8 deletions modules/load_balancer/load_balancer.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,6 @@ static int mod_init(void)
return -1;
}

/* Register the max load recalculation timer */
if (fetch_freeswitch_stats &&
register_timer("lb-update-max-load", lb_update_max_loads, NULL,
fs_api.stats_update_interval, TIMER_FLAG_SKIP_ON_DELAY)<0) {
LM_ERR("failed to register timer for max load recalc!\n");
return -1;
}

if (lb_probe_replies.s) {
lb_probe_replies.len = strlen(lb_probe_replies.s);
if(parse_reply_codes( &lb_probe_replies, &probing_reply_codes,
Expand All @@ -441,6 +433,14 @@ static int mod_init(void)
}
}

/* Register the max load recalculation timer */
if (fetch_freeswitch_stats &&
register_timer("lb-update-max-load", lb_update_max_loads, NULL,
fs_api.stats_update_interval, TIMER_FLAG_SKIP_ON_DELAY)<0) {
LM_ERR("failed to register timer for max load recalc!\n");
return -1;
}

/* parse avps */
if (parse_avp_spec(&group_avp_name_s, &group_avp_name)) {
LM_ERR("cannot parse group avp\n");
Expand Down

0 comments on commit 14df284

Please sign in to comment.