mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-11-02 16:25:18 +00:00
Merge pull request #10655 from donaldsharp/timers_warning_when_large
lib: Add a Dev catch for when a timer is set for > 1 year
This commit is contained in:
commit
787bd3ba6c
@ -68,6 +68,12 @@ static struct log_ref ferr_lib_warn[] = {
|
||||
.description = "The Event subsystem has detected a file descriptor read/write event without an associated handling function. This is a bug, please collect log data and open an issue.",
|
||||
.suggestion = "Gather log data and open an Issue",
|
||||
},
|
||||
{
|
||||
.code = EC_LIB_TIMER_TOO_LONG,
|
||||
.title = "The Event subsystem has detected an internal timer that is scheduled to pop in greater than one year",
|
||||
.description = "The Event subsystem has detected a timer being started that will pop in a timer that is greater than one year. This is a bug, please collect log data and open an issue.",
|
||||
.suggestion = "Gather log data and open an Issue",
|
||||
},
|
||||
{
|
||||
.code = EC_LIB_RMAP_RECURSION_LIMIT,
|
||||
.title = "Reached the Route-Map Recursion Limit",
|
||||
|
||||
@ -48,6 +48,7 @@ enum lib_log_refs {
|
||||
EC_LIB_SLOW_THREAD_WALL,
|
||||
EC_LIB_STARVE_THREAD,
|
||||
EC_LIB_NO_THREAD,
|
||||
EC_LIB_TIMER_TOO_LONG,
|
||||
EC_LIB_RMAP_RECURSION_LIMIT,
|
||||
EC_LIB_BACKUP_CONFIG,
|
||||
EC_LIB_VRF_LENGTH,
|
||||
|
||||
@ -1052,6 +1052,12 @@ static void _thread_add_timer_timeval(const struct xref_threadsched *xref,
|
||||
if (thread_timer_list_first(&m->timer) == thread)
|
||||
AWAKEN(m);
|
||||
}
|
||||
#define ONEYEAR2SEC (60 * 60 * 24 * 365)
|
||||
if (time_relative->tv_sec > ONEYEAR2SEC)
|
||||
flog_err(
|
||||
EC_LIB_TIMER_TOO_LONG,
|
||||
"Timer: %pTHD is created with an expiration that is greater than 1 year",
|
||||
thread);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user