From: Ben Pfaff Date: Wed, 10 Feb 2010 18:41:44 +0000 (-0800) Subject: ovs-brcompatd: Handle transaction errors slightly more gracefully. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fea39b9f1c6a1d05f8a89fbcd82dd01d5c8aa2d4;p=openvswitch 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. --- 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);