Make the "exit" unixctl command reliable in ovsdb-server, ovs-vswitchd.
authorBen Pfaff <blp@nicira.com>
Tue, 16 Nov 2010 23:14:58 +0000 (15:14 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 16 Nov 2010 23:14:58 +0000 (15:14 -0800)
If "ovs-appctl exit" happens to hit ovsdb-server or ovs-vswitchd at a
moment when nothing else is happening to wake the daemon up, it can take a
long time for them to exit.

This seems to account for occasional "make check" failures on Nicira's
internal builds.  It probably fixes some Debian automatic build failures
as well.

ovsdb/ovsdb-server.c
vswitchd/ovs-vswitchd.c

index 872cc9f..c7a9381 100644 (file)
@@ -149,6 +149,9 @@ main(int argc, char *argv[])
         if (run_process) {
             process_wait(run_process);
         }
+        if (exiting) {
+            poll_immediate_wake();
+        }
         poll_block();
     }
     ovsdb_jsonrpc_server_destroy(jsonrpc);
index c307c92..0371e57 100644 (file)
@@ -99,6 +99,9 @@ main(int argc, char *argv[])
         unixctl_server_wait(unixctl);
         dp_wait();
         netdev_wait();
+        if (exiting) {
+            poll_immediate_wake();
+        }
         poll_block();
     }