# cleanup.
kill `cat ovsdb-server.pid`
AT_CLEANUP
+
+dnl ----------------------------------------------------------------------
+AT_SETUP([ovs-vswitchd -- invalid database path])
+
+# start an ovs-vswitchd process with invalid db path.
+ovs-vswitchd unix:invalid.db.sock --log-file=fakelog --enable-dummy --unixctl="`pwd`"/unixctl &
+
+# sleep for a while.
+sleep 10
+
+# stop the process.
+ovs-appctl -t `pwd`/unixctl exit
+
+# should not see this log (which indicates high cpu utilization).
+AT_CHECK([grep "wakeup due to" fakelog], [ignore])
+
+# check the fakelog, should not see any WARN/ERR/EMER log.
+AT_CHECK([sed -n "
+/|WARN|/p
+/|ERR|/p
+/|EMER|/p" fakelog
+])
+
+AT_CLEANUP
static void
status_update_wait(void)
{
+ /* This prevents the process from constantly waking up on
+ * connectivity seq, when there is no connection to ovsdb. */
+ if (!ovsdb_idl_has_lock(idl)) {
+ return;
+ }
+
/* If the 'status_txn' is non-null (transaction incomplete), waits for the
* transaction to complete. If the status update to database needs to be
* run again (transaction fails), registers a timeout in
* with the current situation of multiple ovs-vswitchd daemons,
* disable system stats collection. */
system_stats_enable(false);
- /* This prevents the process from constantly waking up on
- * connectivity seq. */
- connectivity_seqno = seq_read(connectivity_seq_get());
return;
} else if (!ovsdb_idl_has_lock(idl)) {
return;