[ovs-git] Open vSwitch: worker: Prevent worker from being responsible for pidfile deletion. (branch-1.10)

dev at openvswitch.org dev at openvswitch.org
Tue Apr 30 00:14:48 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, branch-1.10 has been updated
       via  aee9c99288e600e5b8cf6abe4ea1596c0cd29a63 (commit)
       via  25cc6b29523b113e2aa775c4abe01828a1d47fb9 (commit)
      from  4036665e1d47d6fa8aeea196e08048360893ce64 (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 aee9c99288e600e5b8cf6abe4ea1596c0cd29a63
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=aee9c99288e600e5b8cf6abe4ea1596c0cd29a63
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 25cc6b29523b113e2aa775c4abe01828a1d47fb9
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=25cc6b29523b113e2aa775c4abe01828a1d47fb9
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