[ovs-git] Open vSwitch: worker: Prevent worker from being responsible for pidfile deletion. (master)
dev at openvswitch.org
dev at openvswitch.org
Mon Apr 29 22:31:11 UTC 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".
The branch, master has been updated
via 7ffd3f6972b41827d7b03e10dcbb0a4c20e4d919 (commit)
via 9f27568d9f6615b486bd13324b9a607864ef8780 (commit)
from 488232b7ec7921753ec27ffd836a51f23afae0b8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7ffd3f6972b41827d7b03e10dcbb0a4c20e4d919
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=7ffd3f6972b41827d7b03e10dcbb0a4c20e4d919
Author: Gurucharan Shetty <gshetty at nicira.com>
worker: Prevent worker from being responsible for pidfile deletion.
Currently we are creating the worker process after creation of the pidfile.
This means that the responsibility of deleting the pidfile after process
termination rests with the worker process.
When we restart openvswitch using the startup scripts, we SIGTERM the main
process and once it is cleaned up, we start ovs-vswitchd again. This results
in a race condition. The new ovs-vswitchd will create a pidfile because it is
unlocked. But, if the old worker process exits after the start of new
ovs-vswitchd, it will simply delete the pidfile underneath the new ovs-vswitchd.
This will eventually result in multiple ovs-vswitchd daemons.
This patch gives the responsibility of deleting the pidfile to the main
process.
Bug #16669.
Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
commit 9f27568d9f6615b486bd13324b9a607864ef8780
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=9f27568d9f6615b486bd13324b9a607864ef8780
Author: Gurucharan Shetty <gshetty at nicira.com>
vswitchd: Disable system stats collection on a concurrently running daemon.
There are very rare cases (ex: ovs-vswitchd.pid is inadvertantly deleted),
when multiple ovs-vswitchd daemons can end up running at the same time.
In a situation like that one of the daemons can wait on the poll()
with a 0 ms wait time as it would be expecting system stats to be collected.
But system stats are never run for the daemon that does not have the
lock on the database and hence it takes up 100% of the CPU if its state
machine for stats collection previously was S_WAITING.
With this patch, we disable the system stats collection for the daemon that
does not have the database lock. When it eventually gets the lock on the
database, system stats are automatically enabled if other_config:\
enable-statistics=true.
Bug #16669.
Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
-----------------------------------------------------------------------
Summary of changes:
lib/daemon.c | 27 +++++++++++++++++++++++++--
lib/daemon.h | 2 ++
lib/worker.c | 4 ++++
vswitchd/bridge.c | 4 ++++
4 files changed, 35 insertions(+), 2 deletions(-)
hooks/post-receive
--
Open vSwitch
More information about the git
mailing list