Skip to content

Conversation

@Fredi-raspall
Copy link
Collaborator

@Fredi-raspall Fredi-raspall commented Jan 26, 2026

Cleans up termination logic and fixes error handling.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
* don't cancel events on termination
* Zebra dplane may call plugin termination functions more than once.
  Fix the methods so that they can be called multiple times without
  creating double-frees or use-after-free conditions.
* Add methods to get list counts and free dplane ctx when shutting
  down.
* Handle the fact that while terminating, zebra may attempt to delete
  routes. When zebra shuts down, the plugin will not delete any state
  in dataplane. This is intended as the expectation is
  that a new instance will be promptly spawn and dataplane will
  then handle any stale routes left by the leaving zebra instance
  after a while. If this behavior is not wanted, the solution is
  to let the plugin issue all requests without expecting (caching)
  any request, unless we want the plugin to block zebra shutdown
  for all requests to be answered.

  Similarly, when finalizing, the plugin answers with a failure
  to zebra. This is so that it believes that all deletions failed,
  preventing it from removing routes (*) from the kernel VRF.
  This is so that, should zebra fail but not other daemons (BGP),
  those can still communicate using the kernel routing tables.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/misc_fixes_termination branch from 1f75607 to b3a48ea Compare January 26, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants