Skip to content

Commit

Permalink
vtep-ctl: Exit if database connection fails.
Browse files Browse the repository at this point in the history
Before this commit vtep-ctl hung forever if it didn't manage to reach
the database.

This caused the testcase "ovn -- 3 HVs, 1 VIFs/HV, 1 GW, 1 LS" to hang
occasionally, because ovsdb-server could be killed before ovs-vtep
called vtep-ctl.

This mimics the behaviour of ovs-vsctl, ovn-nbctl and ovn-sbctl.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
  • Loading branch information
ddiproietto committed Oct 22, 2015
1 parent abcec84 commit df837d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vtep/vtep-ctl.c
Expand Up @@ -135,6 +135,11 @@ main(int argc, char *argv[])
seqno = ovsdb_idl_get_seqno(idl);
for (;;) {
ovsdb_idl_run(idl);
if (!ovsdb_idl_is_alive(idl)) {
int retval = ovsdb_idl_get_last_error(idl);
ctl_fatal("%s: database connection failed (%s)",
db, ovs_retval_to_string(retval));
}

if (seqno != ovsdb_idl_get_seqno(idl)) {
seqno = ovsdb_idl_get_seqno(idl);
Expand Down

0 comments on commit df837d7

Please sign in to comment.