On Thu, Apr 6, 2017 at 6:25 AM, Lucas Alvares Gomes
<lucasago...@gmail.com> wrote:
> This patch is adding a new method set_probe_interval() to the Idl class
> which allows configuring the probe interval for the IDL session.
> Instances of Idl might want to tune this interval to be less agressive
> than the current 5s one.
>
> Reported-at: https://bugs.launchpad.net/networking-ovn/+bug/1680146
> Signed-off-by: Lucas Alvares Gomes <lucasago...@gmail.com>
> ---
>  python/ovs/db/idl.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py
> index 079a03ba1..d3c0086c6 100644
> --- a/python/ovs/db/idl.py
> +++ b/python/ovs/db/idl.py
> @@ -147,6 +147,15 @@ class Idl(object):
>              table.condition = [True]
>              table.cond_changed = False
>
> +    def set_probe_interval(self, probe_interval):
> +        """Sets the probe interval for the IDL session, in milliseconds.
> +
> +        If "probe_interval" is zero it disables the connection keepalive
> +        feature. If non-zero the value will be forced to at least 1000
> +        milliseconds.
> +        """
> +        self._session.reconnect.set_probe_interval(probe_interval)
> +
>      def close(self):
>          """Closes the connection to the database.  The IDL will no longer
>          update."""

Thanks for the patch!

Nothing else in the Idl class is touching the reconnect object
directly, which makes me wonder if this should also be a method on the
session, or perhaps an option to Session.open().

I also wonder if it'd be better as an optional argument to the
constructor so that we can pass in the desired value before the
connection is opened and is used from the beginning.  The separate
method is tempting as far as writing code that can deal with versions
of this library that may or may not have support for the official way
of setting this, but it still feels like the "right" way is to be able
to set the value before the connection is even opened.  What do you
think?

I feel like I'm nit picking this, sorry for that.

-- 
Russell Bryant
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to