summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-10-03 11:49:07 -0400
committerGitHub <noreply@github.com>2019-10-03 11:49:07 -0400
commita8100f512a25c58fa6e82a0876bbb8b6f9eea9fd (patch)
tree23745117212d5a8ef41e529c20b074cfbc6c1281 /zebra/zebra_rib.c
parent6d7b7e42570d81eb22fb05918ea4066321df005b (diff)
parent2fc69f03d2f49fcf34948e82e865cd302ae08da0 (diff)
Merge pull request #5079 from mjstapp/fix_dplane_drop_at_shut
zebra: during shutdown processing, drop dplane results
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index f0601012b6..4a726b3e07 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -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: