Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rcu bites the bitey thing #15298

Merged
merged 2 commits into from
Feb 4, 2024

Conversation

donaldsharp
Copy link
Member

See individual commits.

  1. Ensure the non-controlled startup moves the rcu data structure creation to the earliest point possible. Else calls into things like event_master_create will likely cause a crash
  2. Ensure that the rpki pthreads only call the non-controlled startup one time.

In a non-controlled startup, the rcu data structures were
not being created until after logging could happen.  This
is bad.  Move it so that the rcu data structures are
created first, before logging( HA! ) can happen.

Signed-off-by: Donald Sharp <[email protected]>
As far as I can tell, the rpki code creates a pthread that
is used to handle the i/o associated with talking to the
remote rpki server.  The problem that we are having is that
the rpki code in FRR wants to behave like FRR code and use
the zlog_XXX functions.  These functions all depend on
the RCU code.  Which is a bit picky( and rightly so!!! )
about being started up properly and shut down properly.

This commit is fixing the problem of shutdown.  From
playing with the rpki code, I was able to experimentally
determine that the rpki_create_socket callback function
can be called multiple times per pthread.  Additionally
I was able to clearly see multiple *different* pthreads
actually be created.  This leaves the possiblity
that each time it is called it might be hooking into the
RCU code.  Which makes the rcu code unhappy on shutdown.

Let's address the issue by checking to see if this pthread
has already hooked into the RCU code or not.  If so
then don't do this again.

Signed-off-by: Donald Sharp <[email protected]>
@ton31337 ton31337 added this to the 10.0 milestone Feb 4, 2024
@idryzhov idryzhov merged commit 273356e into FRRouting:master Feb 4, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants