summaryrefslogtreecommitdiff
path: root/lib/ovsdb-idl.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-04-13 09:28:13 -0700
committerBen Pfaff <blp@nicira.com>2010-04-13 09:30:32 -0700
commitb302749b70bd8b487bdfe0ffcdacbf730da8b6ca (patch)
treedc528b241a3bbe9d9b8fab762c614af4ae55bc36 /lib/ovsdb-idl.c
parent9888b1b43ba258e7842100799406f57392c76db7 (diff)
downloadopenvswitch-b302749b70bd8b487bdfe0ffcdacbf730da8b6ca.tar.gz
Make fatal signals cause an exit more promptly in special cases.
The fatal-signal library notices and records fatal signals (e.g. SIGTERM) and terminates the process on the next trip through poll_block(). But some special utilities do not always invoke poll_block() promptly, e.g. "ovs-ofctl monitor" does not call poll_block() as long as OpenFlow messages are available. But these special cases seem like they are all likely to call into functions that themselves block (those with "_block" in their names). So make a new rule that such functions should always call fatal_signal_run(), either directly or through poll_block(). This commit implements and documents that rule. Bug #2625.
Diffstat (limited to 'lib/ovsdb-idl.c')
-rw-r--r--lib/ovsdb-idl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 42c53b831..3f3ce555a 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -25,6 +25,7 @@
#include "bitmap.h"
#include "dynamic-string.h"
+#include "fatal-signal.h"
#include "json.h"
#include "jsonrpc.h"
#include "ovsdb-data.h"
@@ -1281,6 +1282,7 @@ ovsdb_idl_txn_commit_block(struct ovsdb_idl_txn *txn)
{
enum ovsdb_idl_txn_status status;
+ fatal_signal_run();
while ((status = ovsdb_idl_txn_commit(txn)) == TXN_INCOMPLETE) {
ovsdb_idl_run(txn->idl);
ovsdb_idl_wait(txn->idl);