]> git.proxmox.com Git - mirror_ovs.git/commit
ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build
authorNuman Siddique <nusiddiq@redhat.com>
Fri, 2 Nov 2018 11:41:01 +0000 (17:11 +0530)
committerBen Pfaff <blp@ovn.org>
Mon, 5 Nov 2018 15:11:10 +0000 (07:11 -0800)
commitf31b8ae7a7a777dd9dc40997903a283409674eae
tree9d9a0286532e426b2d767cc1fc7220aaf8b1d427
parentdf514c62b6685bda925afab6b5857b2067517354
ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build

When 'make check' is called by the mock rpm build (which disables networking),
the test "ovn-nbctl: LBs - daemon" fails when it runs the command
"ovn-nbctl lb-add lb0 30.0.0.1a 192.168.10.10:80,192.168.10.20:80". ovn-nbctl
extracts the vip by calling the socket util function 'inet_parse_active()',
and this function blocks when libunbound function ub_resolve() is called
further down. ub_resolve() is a blocking function without timeout and all the
ovs/ovn utilities use this function.

As reported by Timothy Redaelli, the issue can also be reproduced by running
the below commands

$ sudo unshare -mn -- sh -c 'ip addr add dev lo 127.0.0.1 && \
  mount --bind /dev/null /etc/resolv.conf && runuser $SUDO_USER'
$ make sandbox SANDBOXFLAGS="--ovn"
$ ovn-nbctl -vsocket_util:off lb-add lb0 30.0.0.1a \
  192.168.10.10:80,192.168.10.20:80

To address this issue, this patch adds a new bool argument 'resolve_host' to
the function inet_parse_active() to resolve the host only if it is 'true'.

ovn-nbctl/ovn-northd will pass 'false' when it calls this function to parse
the load balancer values.

Reported-by: Timothy Redaelli <tredaelli@redhat.com>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1641672
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/socket-util.c
lib/socket-util.h
lib/stream.c
ofproto/ofproto-dpif-sflow.c
ovn/northd/ovn-northd.c
ovn/utilities/ovn-nbctl.c
ovn/utilities/ovn-trace.c
ovsdb/raft-private.c