Merge pull request #13844 from LabNConsulting/aceelindem/bgp-config-callback-log

bgpd: Add config-end timeout error log message.
This commit is contained in:
Donatas Abraitis 2023-06-24 23:22:56 +03:00 committed by GitHub
commit 9410a6aec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18985,6 +18985,9 @@ bool bgp_config_inprocess(void)
return event_is_scheduled(t_bgp_cfg); 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) static void bgp_config_finish(struct event *t)
{ {
struct listnode *node; struct listnode *node;
@ -18994,11 +18997,17 @@ static void bgp_config_finish(struct event *t)
hook_call(bgp_config_end, bgp); 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) static void bgp_config_start(void)
{ {
#define BGP_PRE_CONFIG_MAX_WAIT_SECONDS 600
EVENT_OFF(t_bgp_cfg); 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); BGP_PRE_CONFIG_MAX_WAIT_SECONDS, &t_bgp_cfg);
} }