diff options
author | Ben Pfaff <blp@nicira.com> | 2010-02-10 10:41:44 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-02-10 10:41:44 -0800 |
commit | fea39b9f1c6a1d05f8a89fbcd82dd01d5c8aa2d4 (patch) | |
tree | 5a2cd1b4b1549a292d254c613ccf204b6843408d /vswitchd/ovs-brcompatd.c | |
parent | 9cb53f2613d0194b85dddfdafc11d7193d6561e3 (diff) |
ovs-brcompatd: Handle transaction errors slightly more gracefully.
It is not a good idea to just exit on an OVSDB transaction error.
TXN_TRY_AGAIN will definitely happen in practice; TXN_ERROR should not but
we should not just fail if it does.
This should allow us to better debug bug #2418.
Diffstat (limited to 'vswitchd/ovs-brcompatd.c')
-rw-r--r-- | vswitchd/ovs-brcompatd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index 9994fdb9..beaefb2e 100644 --- a/vswitchd/ovs-brcompatd.c +++ b/vswitchd/ovs-brcompatd.c @@ -1225,7 +1225,6 @@ main(int argc, char *argv[]) ovsdb_idl_txn_wait(txn); poll_block(); } - ovsdb_idl_txn_destroy(txn); switch (status) { case TXN_INCOMPLETE: @@ -1241,16 +1240,19 @@ main(int argc, char *argv[]) case TXN_TRY_AGAIN: /* xxx Handle this better! */ - printf("xxx We need to try again!\n"); + VLOG_ERR("OVSDB transaction needs retry"); break; case TXN_ERROR: - /* xxx Is this what we want to do? */ - ovs_fatal(0, "transaction error"); - + /* xxx Handle this better! */ + VLOG_ERR("OVSDB transaction failed: %s", + ovsdb_idl_txn_get_error(txn)); + break; + default: NOT_REACHED(); } + ovsdb_idl_txn_destroy(txn); nl_sock_wait(brc_sock, POLLIN); ovsdb_idl_wait(idl); |