If the database was empty, that is, it did not even contain an Open_vSwitch top-level configuration record, at ovs-vswitchd startup time, then OVS failed to detach and used 100% CPU. This commit fixes the problem.
This problem was introduced by commit 63ff04e82623e765 (bridge: Only complete daemonization after db commits initial config.). This problem did not manifest if the initscripts supplied with Open vSwitch were used, because those initscripts always initialize the database before starting ovs-vswitchd, so this problem affects only users with hand-rolled local OVS startup scripts. Bug #16090. Reported-by: Pravin Shelar <[email protected]> Tested-by: Pravin Shelar <[email protected]> Reported-by: Paul Ingram <[email protected]> Reported-by: Amre Shakimov <[email protected]> Signed-off-by: Ben Pfaff <[email protected]> --- AUTHORS | 1 + vswitchd/bridge.c | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/AUTHORS b/AUTHORS index 07dce20..e3568bd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -103,6 +103,7 @@ Alex Yip [email protected] Alexey I. Froloff [email protected] Amar Padmanabhan [email protected] Amey Bhide [email protected] +Amre Shakimov [email protected] André Ruß [email protected] Andreas Beckmann [email protected] Atzm Watanabe [email protected] diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 1fcf547..09f98d5 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2269,25 +2269,25 @@ bridge_run(void) } if (reconfiguring) { - if (cfg) { - if (!reconf_txn) { - reconf_txn = ovsdb_idl_txn_create(idl); - } - if (bridge_reconfigure_continue(cfg)) { + if (!reconf_txn) { + reconf_txn = ovsdb_idl_txn_create(idl); + } + + if (bridge_reconfigure_continue(cfg ? cfg : &null_cfg)) { + reconfiguring = false; + + if (cfg) { ovsrec_open_vswitch_set_cur_cfg(cfg, cfg->next_cfg); - reconfiguring = false; - - /* If we are completing our initial configuration for this run - * of ovs-vswitchd, then keep the transaction around to monitor - * it for completion. */ - if (!initial_config_done) { - initial_config_done = true; - daemonize_txn = reconf_txn; - reconf_txn = NULL; - } } - } else { - bridge_reconfigure_continue(&null_cfg); + + /* If we are completing our initial configuration for this run + * of ovs-vswitchd, then keep the transaction around to monitor + * it for completion. */ + if (!initial_config_done) { + initial_config_done = true; + daemonize_txn = reconf_txn; + reconf_txn = NULL; + } } } -- 1.7.2.5 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
