diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2021-03-20 19:52:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-20 19:52:01 -0400 |
| commit | cd28e264a3dbad82c507271ad7773b401f8bcc67 (patch) | |
| tree | 73811bfe2454c078fc7170794e59a93f2631edbb | |
| parent | 97ec501ef0c3e18528152ac330a7e6b2dd8f7a84 (diff) | |
| parent | d2232b3e210fbc5faad95d09ddaf11cb5e88bc94 (diff) | |
Merge pull request #8291 from volta-networks/isis_timer_unstable
isisd: avoid lsp_sched loop when unstable
| -rw-r--r-- | isisd/isis_lsp.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 06a5a69e3f..d610495de6 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -1561,18 +1561,28 @@ int _lsp_regenerate_schedule(struct isis_area *area, int level, /* * Schedule LSP refresh ASAP */ - timeout = 0; - if (area->bfd_signalled_down) { sched_debug( "ISIS (%s): Scheduling immediately due to BDF 'down' message.", area->area_tag); area->bfd_signalled_down = false; area->bfd_force_spf_refresh = true; + timeout = 0; } else { - sched_debug( - "ISIS (%s): Last generation was more than lsp_gen_interval ago. Scheduling for execution now.", - area->area_tag); + int64_t time_since_last = monotime_since( + &area->last_lsp_refresh_event[lvl - 1], + NULL); + timeout = time_since_last < 100000L + ? (100000L - time_since_last)/1000 + : 0; + if (timeout > 0) + sched_debug( + "ISIS (%s): Last generation was more than lsp_gen_interval ago. Scheduling for execution in %ld ms due to the instability timer.", + area->area_tag, timeout); + else + sched_debug( + "ISIS (%s): Last generation was more than lsp_gen_interval ago. Scheduling for execution now.", + area->area_tag); } } |
