Skip to content

Commit

Permalink
ovsdb-idl: Wake up ovsdb_idl_loop when a transaction commits.
Browse files Browse the repository at this point in the history
There is a fair amount of code that defers modifying the database when a
transaction cannot be created (because there is already one outstanding).
This code tends to assume that the main loop will wake up again when it
becomes possible again to modify the database, but the actual ovsdb_id_loop
implementation only did this if the database had changed.  This is too
conservative a policy and may account for some failures I've seen in tests.

Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
blp committed Jul 27, 2016
1 parent 3eefe40 commit ebdc69a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/ovsdb-idl.c
Expand Up @@ -3712,13 +3712,10 @@ ovsdb_idl_loop_commit_and_wait(struct ovsdb_idl_loop *loop)
break;

case TXN_SUCCESS:
/* If the database has already changed since we started the
* commit, re-evaluate it immediately to avoid missing a change
* for a while. */
/* Possibly some work on the database was deferred because no
* further transaction could proceed. Wake up again. */
loop->cur_cfg = loop->next_cfg;
if (ovsdb_idl_get_seqno(loop->idl) != loop->precommit_seqno) {
poll_immediate_wake();
}
poll_immediate_wake();
break;

case TXN_UNCHANGED:
Expand Down

0 comments on commit ebdc69a

Please sign in to comment.