From ee679e506e6791e57c5d60229fef747710ea7c44 Mon Sep 17 00:00:00 2001 From: Acee Date: Sat, 24 Jun 2023 13:29:24 -0400 Subject: [PATCH] bgpd: Add config-end timemout error log message. Signed-off-by: Acee --- bgpd/bgp_vty.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index d03398c80289..e1cc59a31819 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -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; @@ -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); }