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 872cc9f9f4bfae30593f66e786d7a9c67e9eafc5..c7a93815b80346d92519e2bb1c2d0a3e12cf917e 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 c307c9286b89e04db87abbe8b26cf5b55a377976..0371e5711d75c608af0754b6174a597fdbb8f5f2 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();
     }