mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-05 23:53:26 +00:00
Merge pull request #5079 from mjstapp/fix_dplane_drop_at_shut
zebra: during shutdown processing, drop dplane results
This commit is contained in:
commit
a8100f512a
@ -142,6 +142,9 @@ static void sigint(void)
|
||||
|
||||
zlog_notice("Terminating on signal");
|
||||
|
||||
atomic_store_explicit(&zrouter.in_shutdown, true,
|
||||
memory_order_relaxed);
|
||||
|
||||
frr_early_fini();
|
||||
|
||||
zebra_dplane_pre_finish();
|
||||
|
||||
@ -3208,6 +3208,7 @@ static int rib_process_dplane_results(struct thread *thread)
|
||||
{
|
||||
struct zebra_dplane_ctx *ctx;
|
||||
struct dplane_ctx_q ctxlist;
|
||||
bool shut_p = false;
|
||||
|
||||
/* Dequeue a list of completed updates with one lock/unlock cycle */
|
||||
|
||||
@ -3227,6 +3228,21 @@ static int rib_process_dplane_results(struct thread *thread)
|
||||
if (ctx == NULL)
|
||||
break;
|
||||
|
||||
/* If zebra is shutting down, avoid processing results,
|
||||
* just drain the results queue.
|
||||
*/
|
||||
shut_p = atomic_load_explicit(&zrouter.in_shutdown,
|
||||
memory_order_relaxed);
|
||||
if (shut_p) {
|
||||
while (ctx) {
|
||||
dplane_ctx_fini(&ctx);
|
||||
|
||||
ctx = dplane_ctx_dequeue(&ctxlist);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
while (ctx) {
|
||||
switch (dplane_ctx_get_op(ctx)) {
|
||||
case DPLANE_OP_ROUTE_INSTALL:
|
||||
|
||||
@ -74,6 +74,8 @@ struct zebra_mlag_info {
|
||||
};
|
||||
|
||||
struct zebra_router {
|
||||
atomic_bool in_shutdown;
|
||||
|
||||
/* Thread master */
|
||||
struct thread_master *master;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user