From fea39b9f1c6a1d05f8a89fbcd82dd01d5c8aa2d4 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 10 Feb 2010 10:41:44 -0800 Subject: [PATCH] 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. --- vswitchd/ovs-brcompatd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index 9994fdb98..beaefb2e2 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); -- 2.39.5