vswitchd: Disable system stats collection on a concurrently running daemon.
[cascardo/ovs.git] / vswitchd / bridge.c
index b83abad..724b4b9 100644 (file)
@@ -2218,6 +2218,10 @@ bridge_run(void)
             HMAP_FOR_EACH_SAFE (br, next_br, node, &all_bridges) {
                 bridge_destroy(br);
             }
+            /* Since we will not be running system_stats_run() in this process
+             * with the current situation of multiple ovs-vswitchd daemons,
+             * disable system stats collection. */
+            system_stats_enable(false);
             return;
         } else if (!ovsdb_idl_has_lock(idl)) {
             return;
@@ -2284,25 +2288,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;
+            }
         }
     }