diff mbox series

[ovs-dev,v2] controller: Change dns resolution to async.

Message ID 20240405053731.21054-1-naveen.yerramneni@nutanix.com
State Accepted
Headers show
Series [ovs-dev,v2] controller: Change dns resolution to async. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Naveen Yerramneni April 5, 2024, 5:37 a.m. UTC
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>
---
v2: Fix subject line
---
 controller/ovn-controller.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Numan Siddique April 5, 2024, 3:54 p.m. UTC | #1
On Fri, Apr 5, 2024 at 1:38 AM Naveen Yerramneni <
naveen.yerramneni@nutanix.com> wrote:

> 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>
>

Thanks.  I applied this patch to the main.

Numan

---
> v2: Fix subject line
> ---
>  controller/ovn-controller.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
> index c9ff5967a..b84f6dfd4 100644
> --- a/controller/ovn-controller.c
> +++ b/controller/ovn-controller.c
> @@ -85,6 +85,7 @@
>  #include "mirror.h"
>  #include "mac_cache.h"
>  #include "statctrl.h"
> +#include "lib/dns-resolve.h"
>
>  VLOG_DEFINE_THIS_MODULE(main);
>
> @@ -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(
> @@ -6176,6 +6178,7 @@ loop_done:
>      unixctl_server_destroy(unixctl);
>      service_stop();
>      ovsrcu_exit();
> +    dns_resolve_destroy();
>
>      exit(retval);
>  }
> --
> 2.36.6
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
diff mbox series

Patch

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index c9ff5967a..b84f6dfd4 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -85,6 +85,7 @@ 
 #include "mirror.h"
 #include "mac_cache.h"
 #include "statctrl.h"
+#include "lib/dns-resolve.h"
 
 VLOG_DEFINE_THIS_MODULE(main);
 
@@ -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(
@@ -6176,6 +6178,7 @@  loop_done:
     unixctl_server_destroy(unixctl);
     service_stop();
     ovsrcu_exit();
+    dns_resolve_destroy();
 
     exit(retval);
 }