Skip to content

Commit

Permalink
Merge pull request #17969 from donaldsharp/fpm_lost_sends
Browse files Browse the repository at this point in the history
zebra: Ensure dplane does not send work back to master at wrong time
  • Loading branch information
mjstapp authored Feb 4, 2025
2 parents f74fa95 + c411552 commit 704372b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions zebra/zebra_dplane.c
Original file line number Diff line number Diff line change
Expand Up @@ -7528,6 +7528,16 @@ static void dplane_thread_loop(struct event *event)
if (!zdplane_info.dg_run)
break;

/*
* The yield should only happen after a bit of work has been
* done but before we pull any new work off any provider
* queue to continue looping. This is a safe spot to
* do so.
*/
if (event_should_yield(event)) {
reschedule = true;
break;
}
/* Locate next provider */
next_prov = dplane_prov_list_next(&zdplane_info.dg_providers,
prov);
Expand Down Expand Up @@ -7592,11 +7602,6 @@ static void dplane_thread_loop(struct event *event)
zlog_debug("dplane dequeues %d completed work from provider %s",
counter, dplane_provider_get_name(prov));

if (event_should_yield(event)) {
reschedule = true;
break;
}

/* Locate next provider */
prov = next_prov;
}
Expand Down

0 comments on commit 704372b

Please sign in to comment.