Skip to content

Commit

Permalink
zebra: fix route deletion during zebra shutdown
Browse files Browse the repository at this point in the history
Restore the order of execution in zebra's main thread:
  vrf_terminate();
  zebra_dplane_finish();
  zebra_dplane_shutdown();
changed in commit 3b0e170.

  vrf_terminate() enqueues routes for deletion in dplane thread.
  zebra_dplane_shutdown() effectively forces dplane thread
to immediately cease and join (leaving unprocessed routes), while
  zebra_dplane_finish() has a condition that prevents
zebra_dplane_shutdown() from running until all routes queued for
dplane thread have been deleted.

Signed-off-by: Alexander Skorichenko <[email protected]>
  • Loading branch information
askorichenko committed Feb 24, 2024
1 parent 81db169 commit 50af1c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zebra/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ static void sigint(void)

list_delete(&zrouter.client_list);

vrf_terminate();

/* Indicate that all new dplane work has been enqueued. When that
* work is complete, the dataplane will enqueue an event
* with the 'finalize' function.
Expand All @@ -219,8 +221,6 @@ void zebra_finalize(struct event *dummy)
{
zlog_info("Zebra final shutdown");

vrf_terminate();

/*
* Stop dplane thread and finish any cleanup
* This is before the zebra_ns_early_shutdown call
Expand Down

0 comments on commit 50af1c8

Please sign in to comment.