Skip to content

Commit

Permalink
controller: Change dns resolution to async.
Browse files Browse the repository at this point in the history
Currently DNS resolution is a blocking call in OVN controller.
If DNS server is not reachable for any reason then, ovn-controller
thread blocks for longer time and other events are not processed.

Ex: If we try to run ovn-appctl commands during this then, ovn-controller
will not respond for a longer time.

Signed-off-by: Naveen Yerramneni <naveen.yerramneni@nutanix.com>
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
naveen-yerramneni authored and numansiddique committed Apr 5, 2024
1 parent de76bed commit 762ae66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/ovn-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
#include "mirror.h"
#include "mac_cache.h"
#include "statctrl.h"
#include "lib/dns-resolve.h"

VLOG_DEFINE_THIS_MODULE(main);

Expand Down Expand Up @@ -5090,6 +5091,7 @@ main(int argc, char *argv[])
mirror_init();
vif_plug_provider_initialize();
statctrl_init();
dns_resolve_init(true);

/* Connect to OVS OVSDB instance. */
struct ovsdb_idl_loop ovs_idl_loop = OVSDB_IDL_LOOP_INITIALIZER(
Expand Down Expand Up @@ -6176,6 +6178,7 @@ main(int argc, char *argv[])
unixctl_server_destroy(unixctl);
service_stop();
ovsrcu_exit();
dns_resolve_destroy();

exit(retval);
}
Expand Down

0 comments on commit 762ae66

Please sign in to comment.