]> git.puffer.fish Git - mirror/frr.git/commit
lib: defer grpc plugin initialization to post fork 6117/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 30 Mar 2020 18:28:10 +0000 (14:28 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 30 Mar 2020 18:28:10 +0000 (14:28 -0400)
commit20b0a2ed3e8f7c7bb94e52e3fa29086d7dcad2be
treeadcb69a8979adb410763b1bbae9b9209d0d04236
parentff82bbbb912d84a4a9bc22a7efe7f51adada02eb
lib: defer grpc plugin initialization to post fork

When using the GRPC northbound plugin, initialization occurs at the
frr_late_init hook. This is called before fork() when daemonizing (using
-d). Because the GRPC library internally creates threads, this means our
threads go away in the child process, so GRPC doesn't work when used
with -d. Rectify this situation by deferring plugin init to after fork
by scheduling a task on the threadmaster, since those are executed by
the child.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/northbound_grpc.cpp