]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
radvd: pass -m syslog to avoid thread lock for radvd 2.0+
authorIhar Hrachyshka <ihrachys@redhat.com>
Wed, 3 Dec 2014 11:44:57 +0000 (12:44 +0100)
committerIhar Hrachyshka <ihrachys@redhat.com>
Thu, 4 Dec 2014 12:35:56 +0000 (13:35 +0100)
commit72d41174765540bb7672b545c336fb7aaad075e8
tree3ad54c171341be58a464ac4eec4dad8e1926eda0
parentae38d81b61d9111bffe3c5036b3ad16b1aa27f6d
radvd: pass -m syslog to avoid thread lock for radvd 2.0+

Since radvd 2.0, the daemon does not use daemon_fork() function from
libdaemon, but instead calls Linux daemon() function directly. It also
passes (1, 1) arguments when logging method (-m) is either stderr (the
default) or stderr_syslog. The second argument's value = 1 means that
stderr is not closed and left there for (some) log messages.

For neutron, it means that corresponding execute() call that spawns
radvd and expects the invoked process to close stderr does not ever get
completed. The current thread that spawned radvd is locked waiting for
radvd to exit, which does not ever occur unless the process crashes or
receives a signal.

Since L3 agent gives exclusive access to updates queue for each router
to one of processing threads only, it means that the thread that got to
serve a radvd-powered subnet will not proceed and not update any new
ports or other changes to the router anymore.

Passing -m syslog makes radvd 2.0+ close stderr and return to execute()
caller, proceeding with router update processing. The same arguments
should work for old (pre 2.0) versions of radvd too, so passing them
unconditionally.

We could instead use -m logfile and pass appropriate -l <logfile>
argument to radvd to make it log to a log file located in router's
namespace storage path. Though that would be not in line with what
dnsmasq processes currently do for dhcp agent, where we log all messages
to syslog, so sticking to syslog for radvd for consistency.

Change-Id: I131db0639bc46d332ed48faa2bbe68a214264062
Closes-Bug: #1398779
neutron/agent/linux/ra.py
neutron/tests/unit/test_l3_agent.py