Skip to content

Commit

Permalink
Merge pull request FRRouting#13844 from LabNConsulting/aceelindem/bgp…
Browse files Browse the repository at this point in the history
…-config-callback-log

bgpd: Add config-end timeout error log message.
  • Loading branch information
ton31337 authored Jun 24, 2023
2 parents ab2f934 + ee679e5 commit 9410a6a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -18985,6 +18985,9 @@ bool bgp_config_inprocess(void)
return event_is_scheduled(t_bgp_cfg);
}

/* Max wait time for config to load before post-config processing */
#define BGP_PRE_CONFIG_MAX_WAIT_SECONDS 600

static void bgp_config_finish(struct event *t)
{
struct listnode *node;
Expand All @@ -18994,11 +18997,17 @@ static void bgp_config_finish(struct event *t)
hook_call(bgp_config_end, bgp);
}

static void bgp_config_end_timeout(struct event *t)
{
zlog_err("BGP configuration end timer expired after %d seconds.",
BGP_PRE_CONFIG_MAX_WAIT_SECONDS);
bgp_config_finish(t);
}

static void bgp_config_start(void)
{
#define BGP_PRE_CONFIG_MAX_WAIT_SECONDS 600
EVENT_OFF(t_bgp_cfg);
event_add_timer(bm->master, bgp_config_finish, NULL,
event_add_timer(bm->master, bgp_config_end_timeout, NULL,
BGP_PRE_CONFIG_MAX_WAIT_SECONDS, &t_bgp_cfg);
}

Expand Down

0 comments on commit 9410a6a

Please sign in to comment.