2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

idl: Gracefully handle destroying a transaction before receiving its reply.

If ovsdb_idl_txn_destroy() is called to destroy a transaction before its
reply has been received from the database server, then until now we would
drop the connection to the database when the reply actually arrived,
because we would have no record of that transaction ID any longer.

Notably, ovs-vswitchd does this: it "fires and forgets" database
transactions.  (Really, it should not do that, but that's a bigger commit.)

This commit fixes the problem by not dropping the database connection in
such a case.

This fixes an observed problem such that sometimes ovs-vsctl took a long
time to complete, which was because ovs-vswitchd was dropping its
connection to the database and backing off.
This commit is contained in:
Ben Pfaff
2010-01-15 15:22:54 -08:00
parent 88258e0034
commit c5a80c70c1

View File

@@ -266,10 +266,12 @@ ovsdb_idl_run(struct ovsdb_idl *idl)
&& ovsdb_idl_txn_process_reply(idl, msg)) {
/* ovsdb_idl_txn_process_reply() did everything needful. */
} else {
VLOG_WARN("%s: received unexpected %s message",
jsonrpc_session_get_name(idl->session),
jsonrpc_msg_type_to_string(msg->type));
jsonrpc_session_force_reconnect(idl->session);
/* This can happen if ovsdb_idl_txn_destroy() is called to destroy
* a transaction before we receive the reply, so keep the log level
* low. */
VLOG_DBG("%s: received unexpected %s message",
jsonrpc_session_get_name(idl->session),
jsonrpc_msg_type_to_string(msg->type));
}
if (reply) {
jsonrpc_session_send(idl->session, reply);