[ovs-dev] [PATCH 1/1] python: Fix logic resulting in too many unexpected replies Fix logic resulting in too many unexpected replies

2017-02-17 Thread Terry Wilson
. Signed-off-by: Terry Wilson <twil...@redhat.com> --- python/ovs/db/idl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index e43457c..b7b5e1c 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -649,6 +649,7 @@ class Idl(

[ovs-dev] Proposal to move the Python lib to its own repo

2016-11-15 Thread Terry Wilson
/6766131b42807829ea78dbc43d164db8926030e7 commit 6766131b42807829ea78dbc43d164db8926030e7 Author: Terry Wilson <twil...@redhat.com> Date: Mon Nov 14 16:03:43 2016 -0600 Move python dir to a submodule diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000..db21481 --- /dev/null +++ b/.gitm

Re: [ovs-dev] [PATCH v2] python: Allow tuning the session probe_interval from IDL

2017-04-10 Thread Terry Wilson
ovsdb-server has the ability to create additional servers based on a DB contents. For the Open_vSwitch schema, that's the Manager table and the Open_vSwitch table's manager_options column. The ovsdb-server code refers to these as "remotes". If these remotes have a max_backoff/inactivity_probe

[ovs-dev] [PATCH v1 1/1] Build the JSON C extension for the Python lib

2017-08-17 Thread Terry Wilson
The JSON C extensions performs much better than the pure Python version, so build it when producing RPMs. Signed-off-by: Terry Wilson <twil...@redhat.com> --- rhel/openvswitch-fedora.spec.in | 33 - 1 file changed, 24 insertions(+), 9 deletions(-) diff

[ovs-dev] [PATCH] Fix flake8 check

2017-05-18 Thread Terry Wilson
Stop occluding the previous definition of filename. Signed-off-by: Terry Wilson <twil...@redhat.com> --- Documentation/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index d70ee6b..62531dd 100644 --- a/Documen

[ovs-dev] OVS no longer compiles on Centos 7 (gcc 4.8.5)

2017-11-30 Thread Terry Wilson
As of the ETH_ADDR_C patch (https://patchwork.ozlabs.org/patch/842364/), ovs won't compile on gcc 4.8.5 which ships with Centos 7. It works fine on 7.2.1 which ships in Fedora 27. lots of: ../include/openvswitch/types.h:186:47: error: initializer element is not constant #define

[ovs-dev] [PATCH] Add ovs.compat module to python package

2018-08-10 Thread Terry Wilson
Signed-off-by: Terry Wilson --- python/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 0e86834..b52657d 100644 --- a/python/setup.py +++ b/python/setup.py @@ -63,7 +63,8 @@ setup_args = dict( url='http

Re: [ovs-dev] [PATCH v2 1/2] table: append newline when printing tables

2018-08-08 Thread Terry Wilson
ot;table: New function table_format() for formatting a > table as a string.") > Cc: Ben Pfaff > Cc: Jakub Sitnicki > Reported-by: Terry Wilson > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1608508 > Signed-off-by: Aaron Conole > Suggested-by: Ben Pfaff > -

Re: [ovs-dev] [PATCH] Fix socket permissions on Linux

2018-08-16 Thread Terry Wilson
> Gather 'round folks, and let me tell you the tale of a series long > ago posted: > > https://mail.openvswitch.org/pipermail/ovs-dev/2016-August/321866.html > > Something... something ... black magic... > I think the fchmod needs to happen after the bind for the permissions > to actually be

Re: [ovs-dev] [PATCH] Fix socket permissions on Linux

2018-08-16 Thread Terry Wilson
On Thu, Aug 16, 2018 at 4:57 PM, Ben Pfaff wrote: > On Thu, Aug 16, 2018 at 07:55:09PM +0000, Terry Wilson wrote: >> Unix sockets were not being created with the permission 0770, >> instead using the current umask value. The manpage for fchmod() >> states that that if filed

Re: [ovs-dev] [PATCH] Fix socket permissions on Linux

2018-08-16 Thread Terry Wilson
>> Surely there's a better way to do this. > > I *hope* so. I mean it certainly seems like something one would want > to be able to do, but I remember looking for a couple of days 2 years > ago and giving up. umask seemed like the only reliable option. > Whatever the solution is, fchmod is *not*

Re: [ovs-dev] [PATCH] Fix socket permissions on Linux

2018-08-16 Thread Terry Wilson
>> It doesn't (and never has) on my Centos 7 machine. I ran into this a >> couple of years ago and ended up just working around it. As an example >> after make rpm-fedora and installing: >> [centos@test x86_64]$ ls -al /var/run/openvswitch/db.sock >> srwxr-x---. 1 openvswitch openvswitch0 Aug

[ovs-dev] [PATCH][backport] Add ovs.compat module to python package

2018-08-31 Thread Terry Wilson
The Python multi-column index patch also made it into 2.9, so the setup.py fix needs backported there as well. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev

[ovs-dev] [PATCH] Add ovs.compat module to python package

2018-08-31 Thread Terry Wilson
Signed-off-by: Terry Wilson Signed-off-by: Ben Pfaff Acked-by: Timothy Redaelli (cherry picked from commit 2360464d629de3acacabd960ffc02fbb5081028d) --- python/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 0e86834

Re: [ovs-dev] [PATCH] OVN python IDL: avoid useless JSON conversion to enhance performance

2018-02-27 Thread Terry Wilson
On Tue, Feb 27, 2018 at 9:25 AM, Daniel Alvarez wrote: > This patch removes a useless conversion to/from JSON in the > processing of any 'modify' operations inside the process_update2 > method in Python IDL implementation. > > Previous code will make resources creation take

Re: [ovs-dev] [RFC] [PATCH] 1/1 Add multi-column index support for the Python IDL

2018-04-11 Thread Terry Wilson
03:03:03PM -0500, twil...@redhat.com wrote: >> > > From: Terry Wilson <twil...@redhat.com> >> > > >> > > This adds multi-column index support for the Python IDL that is >> > > similar to the feature in the C IDL. >> > > >> > >

Re: [ovs-dev] [PATCH v2] Add multi-column index support for the Python IDL

2018-04-13 Thread Terry Wilson
One could argue that if if distro packaging is the issue, then distros could patch in the simple try/except ImportError and add the sortedcontainer code like I did above. But, if this works for the ovs team and distro folks, I'm happy with it. Terry ___

Re: [ovs-dev] [PATCH v2] python: avoid useless JSON conversion to enhance performance

2018-02-28 Thread Terry Wilson
...@redhat.com> > Reported-at: > https://mail.openvswitch.org/pipermail/ovs-discuss/2018-February/046263.html > Signed-off-by: Daniel Alvarez <dalva...@redhat.com> > Acked-by: Terry Wilson <twil...@redhat.com> > Acked-by: Han Zhou <hzh...@ebay.com> > --- > pytho

[ovs-dev] Point releases

2018-10-11 Thread Terry Wilson
Just curious what the schedule/process for doing point releases was? I noticed that there are 100 patches in branch-2.9 after 2.9.2 and 70 in branch-2.10 after 2.10.0. Is it just kind of "when it seems right?" I ask because there was python-ovs patch that we'd like to get into a release (it's been

Re: [ovs-dev] [PATCH 2/2 v2] Work around Python/C JSON unicode differences

2018-10-09 Thread Terry Wilson
Anyone have time to look at these? On Mon, Oct 1, 2018 at 11:24 AM Terry Wilson wrote: > > The OVS C-based JSON parser operates on bytes, so the parser_feed > function returns the number of bytes that are processed. The pure > Python JSON parser currently operates on unicode, s

Re: [ovs-dev] [PATCH 2/2 v2] Work around Python/C JSON unicode differences

2018-10-09 Thread Terry Wilson
On Tue, Oct 9, 2018 at 11:28 AM Terry Wilson wrote: > > Anyone have time to look at these? Huh, apparently they hadn't shown up due to being marked as spam or something. Re-sent. ___ dev mailing list d...@openvswitch.org https://mail.openvswit

[ovs-dev] [PATCH 1/2 v2] Test the Python C JSON extension

2018-10-09 Thread Terry Wilson
/python directory and makes the tests configurable to use both JSON backends. There are some unicode failures in the C JSON extension that I left unfixed in this patch to make it easy to show run the new tests on broken code. The next patch in this set works around the issue. Signed-off-by: Terry

[ovs-dev] [PATCH 2/2 v2] Work around Python/C JSON unicode differences

2018-10-09 Thread Terry Wilson
unicode characters are passed to the C JSON parser from Python. Signed-off-by: Terry Wilson --- python/ovs/jsonrpc.py | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/ovs/jsonrpc.py b/python/ovs/jsonrpc.py index 4873cff..1323ba7 100644 --- a/python/ovs/jsonrpc.py

[ovs-dev] [PATCH 1/2] Test the Python C JSON extension

2018-09-19 Thread Terry Wilson
/python directory and makes the tests configurable to use both JSON backends. There are some unicode failures in the C JSON extension that I left unfixed in this patch to make it easy to show run the new tests on broken code. The next patch in this set works around the issue. Signed-off-by: Terry

[ovs-dev] [PATCH 2/2] Work around Python/C JSON unicode differences

2018-09-19 Thread Terry Wilson
unicode characters are passed to the C JSON parser from Python. Signed-off-by: Terry Wilson --- python/ovs/jsonrpc.py | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/ovs/jsonrpc.py b/python/ovs/jsonrpc.py index 4873cff..1323ba7 100644 --- a/python/ovs/jsonrpc.py

[ovs-dev] [PATCH] Un-revert Work around Python/C JSON unicode differences

2019-01-14 Thread Terry Wilson
. The pure Python JSON parser currently operates on unicode, so it expects that Parser.feed() returns a number of characters. This difference leads to parsing errors when unicode characters are passed to the C JSON parser from Python. Signed-off-by: Terry Wilson --- python/ovs/json.py| 10

Re: [ovs-dev] [PATCH] Revert "Test the Python C JSON extension"

2018-12-13 Thread Terry Wilson
Sorry I missed this...thanks for the in-depth analysis! On Tue, Oct 16, 2018 at 3:16 AM Lam, Tiago wrote: > > On 15/10/2018 17:44, Ilya Maximets wrote: > > This reverts commit a7be68a4d77791bbe02c37f7ad8ae60b02e5679e > > and a subsequent commit 4617d1f6bd24c543f533f6485b42ebca6b0a8371. > > There

[ovs-dev] [PATCH] Correct documentation for getting DB's cid

2018-12-13 Thread Terry Wilson
Signed-off-by: Terry Wilson --- Documentation/ref/ovsdb.7.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ref/ovsdb.7.rst b/Documentation/ref/ovsdb.7.rst index f891309..c43fe17 100644 --- a/Documentation/ref/ovsdb.7.rst +++ b/Documentation/ref/ovsdb.7.rst

Re: [ovs-dev] [PATCH] Shutdown SSL connection before closing socket

2019-07-10 Thread Terry Wilson
An example of a reproducer script attached. If you enable SSL and OVN w/ the sandbox and run it, looking in the sandbox/nb1.log you'll see the disconnect errors that the patch makes go away. On Wed, Jul 10, 2019 at 11:07 AM Terry Wilson wrote: > Without shutting down the SSL connection,

Re: [ovs-dev] [PATCH] Shutdown SSL connection before closing socket

2019-07-10 Thread Terry Wilson
wrote: > On 7/10/19 12:11 PM, Terry Wilson wrote: > > An example of a reproducer script attached. If you enable SSL and OVN w/ > > the sandbox and run it, looking in the sandbox/nb1.log you'll see the > > disconnect errors that the patch makes go away. > > > > Hi

[ovs-dev] [PATCH] Shutdown SSL connection before closing socket

2019-07-10 Thread Terry Wilson
. This just adds an SSLStream.close() that calls shutdown() and ignores read/write errors. Signed-off-by: Terry Wilson --- python/ovs/stream.py | 8 1 file changed, 8 insertions(+) diff --git a/python/ovs/stream.py b/python/ovs/stream.py index c15be4b..fd1045e 100644 --- a/python/ovs

[ovs-dev] [PATCH v2] Shutdown SSL connection before closing socket

2019-07-11 Thread Terry Wilson
. This just adds an SSLStream.close() that calls shutdown() and ignores SSL errors, the same way that lib/stream-ssl.c does in ssl_close(). Signed-off-by: Terry Wilson --- python/ovs/stream.py | 8 1 file changed, 8 insertions(+) diff --git a/python/ovs/stream.py b/python/ovs/stream.py

Re: [ovs-dev] [PATCH] Shutdown SSL connection before closing socket

2019-07-11 Thread Terry Wilson
; On Wed, Jul 10, 2019 at 11:07:16AM -0500, Terry Wilson wrote: > > Without shutting down the SSL connection, log messages like: > > > > stream_ssl|WARN|SSL_read: unexpected SSL connection close > > jsonrpc|WARN|ssl:127.0.0.1:47052: receive error: Protocol error > > rec

[ovs-dev] [PATCH] Add a __str__ method to idl.Row

2019-09-03 Thread Terry Wilson
It's sometimes handy to log an entire Row object, so this just adds a string representation of the object as: Tablename(col1=val1, col2=val2, ..., coln=valn) Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/python/ovs/db/idl.py b

Re: [ovs-dev] [PATCH] OVN resource agent - make promotion synchronous

2019-07-17 Thread Terry Wilson
Is this just waiting on a couple of line length issues to be fixed? Or do those really matter? On Tue, Jul 9, 2019 at 3:10 AM 0-day Robot wrote: > Bleep bloop. Greetings Michele Baldessari, I am a robot and I have tried > out your patch. > Thanks for your contribution. > > I encountered some

Re: [ovs-dev] [PATCH v2] Shutdown SSL connection before closing socket

2019-07-25 Thread Terry Wilson
Thanks! Could I get a backport to whatever branches backports are still available for? I tested that it applied cleanly on 2.9 and passed tests there. That code hasn't changed in a while. On Tue, Jul 16, 2019 at 12:20 PM Ben Pfaff wrote: > On Thu, Jul 11, 2019 at 08:00:20AM -0500, Terry Wil

[ovs-dev] [PATCH] python: Handle refTable values with setkey()

2020-03-13 Thread Terry Wilson
column instead of trying to build it. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py| 3 +-- tests/idltest.ovsschema | 15 +++ tests/ovsdb-idl.at | 12 tests/test-ovsdb.py | 23 ++- 4 files changed, 50 insertions(+), 3 deletions

Re: [ovs-dev] [PATCH v3] [python] Handle refTable values with setkey()

2020-04-29 Thread Terry Wilson
Any chance we could get this ( 9435b0b8 ) backported to 2.13 and 2.12 (it backported cleanly and passed tests on my box). Thanks! On Fri, Mar 20, 2020 at 10:48 AM Ben Pfaff wrote: > On Fri, Mar 20, 2020 at 03:22:38PM +0000, Terry Wilson wrote: > > For columns like QoS.queues where we h

[ovs-dev] [PATCH v2] python: Handle refTable values with setkey()

2020-03-20 Thread Terry Wilson
column instead of trying to build it. Signed-off-by: Terry Wilson --- manpages.mk | 3 --- python/ovs/db/idl.py| 3 +-- tests/idltest.ovsschema | 15 +++ tests/ovsdb-idl.at | 13 + tests/test-ovsdb.py | 23 ++- 5 files changed

Re: [ovs-dev] [PATCH v2] python: Handle refTable values with setkey()

2020-03-20 Thread Terry Wilson
gah, somehow manpages.mk changed... reuploaded fixed version. :-/ On Fri, Mar 20, 2020 at 10:18 AM Terry Wilson wrote: > For columns like QoS.queues where we have a map containing refTable > values, assigning w/ __setattr__ e.g. qos.queues={1: $queue_row} > works, but using using q

[ovs-dev] [PATCH v3] [python] Handle refTable values with setkey()

2020-03-20 Thread Terry Wilson
column instead of trying to build it. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py| 3 +-- tests/idltest.ovsschema | 15 +++ tests/ovsdb-idl.at | 13 + tests/test-ovsdb.py | 23 ++- 4 files changed, 51 insertions(+), 3 deletions

[ovs-dev] [PATCH] Don't raise an Exception on failure to connect via SSL

2020-09-15 Thread Terry Wilson
get_exception_errno will simply return errno.EPROTO for. Signed-off-by: Terry Wilson --- python/ovs/socket_util.py | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/ovs/socket_util.py b/python/ovs/socket_util.py index 3faa64e9d..ffcdd28cb 100644 --- a/python/ovs

[ovs-dev] [PATCH v2] Don't raise an Exception on failure to connect via SSL

2020-09-15 Thread Terry Wilson
-off-by: Terry Wilson --- python/ovs/stream.py | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/python/ovs/stream.py b/python/ovs/stream.py index e9bb0c854..f5a520862 100644 --- a/python/ovs/stream.py +++ b/python/ovs/stream.py @@ -132,6 +132,10 @@ class Stream

Re: [ovs-dev] [PATCH] Don't raise an Exception on failure to connect via SSL

2020-09-15 Thread Terry Wilson
On Tue, Sep 15, 2020 at 2:55 PM Ilya Maximets wrote: > On 9/15/20 7:17 PM, Terry Wilson wrote: > > With other socket types, trying to connect and failing will return > > an error code, but if an SSL Stream is used, then when > > check_connection_completion(sock) is c

Re: [ovs-dev] [PATCH v2] Don't raise an Exception on failure to connect via SSL

2020-10-13 Thread Terry Wilson
the possible exceptions similar to how > > lib/stream-ssl.c's interpret_ssl_error() works across the various > > methods that are implemented. > > > > Signed-off-by: Terry Wilson https://mail.openvswitch.org/mailman/listinfo/ovs-dev>> > > --- > &g

Re: [ovs-dev] [PATCH] ovs-ctl: Don't set hostname as external-id

2020-05-22 Thread Terry Wilson
On Wed, May 20, 2020 at 10:52 AM Daniel Alvarez wrote: > ovs-ctl started to add the hostname as external-id [0] at some point. > > However, this can be problematic as if it's already set by an external > entity it will get overwritten. In RHEL systems, systemd will invoke > ovs-ctl to start OVS

Re: [ovs-dev] [PATCH v2] Don't raise an Exception on failure to connect via SSL

2020-10-27 Thread Terry Wilson
Just bumping to make sure this doesn't fall through the cracks. 11 days since the last ack. Let me know if there's anything else that needs changing. Thanks! On Fri, Oct 16, 2020 at 1:37 AM Thomas Neuman wrote: > Yup, fair enough. LGTM > > Acked-by: Thomas Neuman > > > > > I get why it seems a

Re: [ovs-dev] [PATCH] Don't raise an Exception on failure to connect via SSL

2020-11-12 Thread Terry Wilson
Just checking in again to see if I could get a committer's eye on this one. Got a couple of Acks, just trying to make it the last lap. Thanks! ;) On Tue, Sep 15, 2020 at 12:17 PM Terry Wilson wrote: > With other socket types, trying to connect and failing will return > an erro

[ovs-dev] [PATCH v3] [python] Don't mix system poll/monkeypatched select

2021-06-11 Thread Terry Wilson
. Signed-off-by: Terry Wilson --- python/ovs/poller.py | 35 ++- python/ovs/socket_util.py | 9 ++--- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/python/ovs/poller.py b/python/ovs/poller.py index 3624ec865..7b3238d6d 100644 --- a/python

[ovs-dev] [PATCH v2] [python] Don't mix system poll/monkeypatched select

2021-06-11 Thread Terry Wilson
. Signed-off-by: Terry Wilson --- python/ovs/poller.py | 35 ++- python/ovs/socket_util.py | 11 +++ 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/python/ovs/poller.py b/python/ovs/poller.py index 3624ec865..7b3238d6d 100644 --- a/python

[ovs-dev] [PATCH] [python] Don't mix system poll/monkeypatched select

2021-06-11 Thread Terry Wilson
. Signed-off-by: Terry Wilson --- python/ovs/poller.py | 35 ++- python/ovs/socket_util.py | 6 +- 2 files changed, 7 insertions(+), 34 deletions(-) diff --git a/python/ovs/poller.py b/python/ovs/poller.py index 3624ec865..7b3238d6d 100644 --- a/python/ovs

Re: [ovs-dev] [PATCH v3] [python] Don't mix system poll/monkeypatched select

2021-07-01 Thread Terry Wilson
Sounds good to me. As you said before, the call to poll(0) itself doesn't appear to block eventlet. Further inspection showed that the issue that we were seeing was actually caused by cpu-bound code in python-ovs that was blocking eventlet on connection in __do_parse_update() and, if not using the

[ovs-dev] [PATCH 0/1] [python] Cooperatively yielding to eventlet/gevent

2021-07-01 Thread Terry Wilson
quot;) helper = idl.SchemaHelper(None) helper.register_all() ovs_idl = idl.Idl("tcp:127.0.0.1:6640", helper) #ovs_idl = YieldingIdl("tcp:127.0.0.1:6640", helper) eventlet.spawn_n(print_count) run_idl() Terry Wilson (1): [python] Add cooperative_yield() API method to

[ovs-dev] [PATCH 1/1] [python] Add cooperative_yield() API method to Idl

2021-07-01 Thread Terry Wilson
that defaults to doing nothing, but can be overridden to yield as needed. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 11 +++ 1 file changed, 11 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index 889cf3431..751feb47f 100644 --- a/python/ovs/db/idl.py

[ovs-dev] [PATCH 1/2] Handle refTable values with setkey()

2021-03-16 Thread Terry Wilson
column instead of trying to build it. Signed-off-by: Terry Wilson Signed-off-by: Ben Pfaff Signed-off-by: Ilya Maximets (cherry picked from commit 818cd7ae13f23fa5ceadf628ba5a6b712936af9f) --- python/ovs/db/idl.py| 3 +-- tests/idltest.ovsschema | 15 +++ tests/ovsdb-idl.at

[ovs-dev] [PATCH 2/2] python: Send notifications after the transaction ends.

2021-03-16 Thread Terry Wilson
methods return the notifications that would be produced when a row changes, so they can be queued and sent after all rows have been processed. Fixes: d7d417fcddf9 ("Allow subclasses of Idl to define a notification hook") Signed-off-by: Terry Wilson Acked-by: Brian Haley Acked-by: Dumitru Cea

[ovs-dev] [PATCH 0/2] [python] 2.11 backports to help neutron upstream CI

2021-03-16 Thread Terry Wilson
was made. The neutron upstream CI for the stable/train branch caps the version of ovs at 2.11, and there are some test failures due to the notification bug that are holding up ~10 patches that are being backported. Terry Wilson (2): Handle refTable values with setkey() python: Send notifications

[ovs-dev] [PATCH v6] python: Send notifications after the transaction ends

2021-03-09 Thread Terry Wilson
methods return the notifications that would be produced when a row changes, so they can be queued and sent after all rows have been processed. Fixes: d7d417fcddf9 ("Allow subclasses of Idl to define a notification hook") Signed-off-by: Terry Wilson --- python/ovs/db/i

Re: [ovs-dev] [PATCH v6] python: Send notifications after the transaction ends

2021-03-15 Thread Terry Wilson
On Mon, Mar 15, 2021 at 11:50 AM Ilya Maximets wrote: > Thanks, Terry, Brian, Dumitru and Flavio! > Applied to master and backported down to 2.13. > > Best regards, Ilya Maximets. Thanks! Can I get it backported down to 2.11 at least? I think the issue goes back to at least 2.10. There's

[ovs-dev] [PATCH v3] python: Send notifications after the transaction ends

2021-03-03 Thread Terry Wilson
methods return the notifications that would be produced when a row changes, so they can be queued and sent after all rows have been processed. Fixes: d7d417fcddf9 ("Allow subclasses of Idl to define a notification hook") Signed-off-by: Terry Wilson --- python/ovs/db/i

Re: [ovs-dev] [PATCH v2] python: Send notifications after the transaction ends

2021-03-03 Thread Terry Wilson
On Wed, Mar 3, 2021 at 1:47 PM Brian Haley wrote: > > Hi Terry, > > Thanks for the patch, comments below. > > On 3/3/21 9:24 AM, Terry Wilson wrote: > > The Python IDL notification mechanism was sending a notification > > for each processed update in a t

[ovs-dev] [PATCH v2] python: Send notifications after the transaction ends

2021-03-03 Thread Terry Wilson
methods return the notifications that would be produced when a row changes, so they can be queued and sent after all rows have been processed. Fixes: d7d417fcddf9 ("Allow subclasses of Idl to define a notification hook") Signed-off-by: Terry Wilson --- python/ovs/db/i

[ovs-dev] [PATCH v4 1/1] python: Send notifications after the transaction ends

2021-03-04 Thread Terry Wilson
The Python IDL notification mechanism was sending a notification for each processed update in a transaction as it was processed. This causes issues with multi-row changes that contain references to each other. For example, if a Logical_Router_Port is created along with a Gateway_Chassis, and the

[ovs-dev] [PATCH v4 0/1] Send notifications after the transaction ends

2021-03-04 Thread Terry Wilson
, but consistently putting Logical_Router_Port before Gateway_Chassis. In py3 things could still fail as in the test case provided, e.g. if rows referenced each other in the same transaction, or depending on the order in which ovsdb-server adds the updates. Terry Wilson (1): python: Send notifications after

[ovs-dev] [PATCH v5] python: Send notifications after the transaction ends

2021-03-04 Thread Terry Wilson
methods return the notifications that would be produced when a row changes, so they can be queued and sent after all rows have been processed. Fixes: d7d417fcddf9 ("Allow subclasses of Idl to define a notification hook") Signed-off-by: Terry Wilson --- python/ovs/db/i

[ovs-dev] [PATCH] [python] Avoid sending transactions when the DB is not synced up

2021-09-01 Thread Terry Wilson
for a database that the IDL had just learned did not exist on the server. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index ecae5e143..0be0064de 100644 --- a/python/ovs/db/idl.py +++ b

[ovs-dev] [PATCH v2] [python] Avoid sending transactions when the DB is not synced up

2021-09-02 Thread Terry Wilson
for a database that the IDL had just learned did not exist on the server. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index ecae5e143..f24dc5eaf 100644 --- a/python/ovs/db/idl.py +++ b

[ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-09-02 Thread Terry Wilson
for a database that the IDL had just learned did not exist on the server. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 5 + 1 file changed, 5 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index ecae5e143..87ee06cde 100644 --- a/python/ovs/db/idl.py +++ b

Re: [ovs-dev] [PATCH] [python] Avoid sending transactions when the DB is not synced up

2021-09-01 Thread Terry Wilson
/c39751e44539a014e642bcd930cb9e3a33af1805 was the update notification from the monitor request. Now that there are requests for _Server, etc., that no longer works. On Wed, Sep 1, 2021 at 11:15 AM Terry Wilson wrote: > > This ports the C IDL change f50714b to the Python IDL: > > Until now the code here would happily

Re: [ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-09-20 Thread Terry Wilson
On Thu, Sep 2, 2021 at 10:53 AM Dumitru Ceara wrote: > > On 9/2/21 5:34 PM, Terry Wilson wrote: > > This ports the C IDL change f50714b to the Python IDL: > > > > Until now the code here would happily try to send transactions to the > > database server e

[ovs-dev] [PATCH branch-2.14] python: idl: Avoid sending transactions when the DB is not synced up.

2021-10-13 Thread Terry Wilson
for a database that the IDL had just learned did not exist on the server. Signed-off-by: Terry Wilson (cherry picked from commit 34fbdc41084c16f855efa9c56086b03644408b7d) --- python/ovs/db/idl.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py

Re: [ovs-dev] [PATCH branch-2.14] python: idl: Avoid sending transactions when the DB is not synced up.

2021-10-13 Thread Terry Wilson
On Wed, Oct 13, 2021 at 11:13 AM Terry Wilson wrote: > > This ports the C IDL change f50714b to the Python IDL: > > Until now the code here would happily try to send transactions to the > database server even if the database connection was not in the correct > state. In som

[ovs-dev] [PATCH] [python] Avoid alloc of an attr dict/row+column

2021-10-12 Thread Terry Wilson
be millions of rows in a database, avoiding this allocation with __slots__ can save 100s of MBs of memory per Idl process. Signed-off-by: Terry Wilson --- python/ovs/db/data.py | 4 1 file changed, 4 insertions(+) diff --git a/python/ovs/db/data.py b/python/ovs/db/data.py index 99bf80ed6

[ovs-dev] [PATCH] [python] Avoid pre-allocating column defaults

2021-10-12 Thread Terry Wilson
' fields set, this saves around 300MB of memory. One could argue that if values are not going to change from their defaults, then users should not be monitoring those columns, but it's also probably good to not waste memory even if user code is sub-optimal. Signed-off-by: Terry Wilson --- python

Re: [ovs-dev] [PATCH v2] python: replace pyOpenSSL with ssl

2021-10-13 Thread Terry Wilson
try: > -self.socket.shutdown() > -except SSL.Error: > + self.socket.shutdown(socket.SHUT_RDWR) > +except (socket.error, OSError, ValueError): > pass > return super(SSLStream, self).close() > > > -if SSL: > +if ssl: > # Register SSL only if the OpenSSL module is available > Stream.register_method("ssl", SSLStream) > diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at > index 501c13b81..0f229b2f9 100644 > --- a/tests/ovsdb-idl.at > +++ b/tests/ovsdb-idl.at > @@ -225,7 +225,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY], > m4_define([OVSDB_CHECK_IDL_SSL_PY], >[AT_SETUP([$1 - Python3 - SSL]) > AT_SKIP_IF([test "$HAVE_OPENSSL" = no]) > - $PYTHON3 -c "import OpenSSL.SSL" > + $PYTHON3 -c "import ssl" > SSL_PRESENT=$? > AT_SKIP_IF([test $SSL_PRESENT != 0]) > AT_KEYWORDS([ovsdb server idl positive Python with ssl socket $5]) > -- > 2.31.1 > I tested with the neutron ml2/ovn tests that run over SSL and everything behaved the same. Nice work--what a pain! Acked-by: Terry Wilson Tested-by: Terry Wilson ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev

[ovs-dev] [PATCH] [python] Allow custom transaction ops to be added

2021-10-13 Thread Terry Wilson
It can be useful to be able to send raw transaction operations through the Idl's connection. For example, to clean up MAC_Binding entries for floating IPs without having to monitor the MAC_Binding table which can be quite large. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 18

Re: [ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-10-12 Thread Terry Wilson
On Mon, Sep 20, 2021 at 1:18 PM Ilya Maximets wrote: > > On 9/20/21 20:10, Terry Wilson wrote: > > The problem is that has_ever_connected() doesn't imply that we have > > downloaded the db into memory since the _Server stuff was added. > > Hmm. That doe

Re: [ovs-dev] [PATCH] Backup and remove existing DB when joining cluster

2021-10-20 Thread Terry Wilson
On Wed, Oct 20, 2021 at 2:45 PM Terry Wilson wrote: > > ovsdb-tool join-cluster requires a remote addr, so the existing > code that tried to join a cluster without it when there was an > existing $DB_FILE would fail. > > Instead, if we are trying to specifica

[ovs-dev] [PATCH] Backup and remove existing DB when joining cluster

2021-10-20 Thread Terry Wilson
continuing to join the cluster. Signed-off-by: Terry Wilson --- utilities/ovs-lib.in | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 3eda01d3c..06f4319d5 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in

[ovs-dev] [PATCH v2] Backup and remove existing DB when joining cluster

2021-10-20 Thread Terry Wilson
continuing to join the cluster. Signed-off-by: Terry Wilson --- utilities/ovs-lib.in | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 3eda01d3c..a710f053a 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in

Re: [ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-09-20 Thread Terry Wilson
On Mon, Sep 20, 2021 at 12:29 PM Ilya Maximets wrote: > > On 9/20/21 18:15, Terry Wilson wrote: > > On Thu, Sep 2, 2021 at 10:53 AM Dumitru Ceara wrote: > >> > >> On 9/2/21 5:34 PM, Terry Wilson wrote: > >>> This ports the C IDL change f50714b to the

Re: [ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-09-20 Thread Terry Wilson
The problem is that has_ever_connected() doesn't imply that we have downloaded the db into memory since the _Server stuff was added. On Mon, Sep 20, 2021 at 1:05 PM Ilya Maximets wrote: > > On 9/20/21 19:58, Terry Wilson wrote: > > On Mon, Sep 20, 2021 at 12:29 PM Ilya Max

Re: [ovs-dev] [PATCH] python: replace pyOpenSSL with ssl

2021-09-29 Thread Terry Wilson
I'll take a look this morning and run it through the neutron ml2/ovn SSL-related tests. Terry On Fri, Sep 10, 2021 at 9:34 AM Timothy Redaelli wrote: > > Currently, pyOpenSSL is half-deprecated upstream and so it's removed on > some distributions (for example on CentOS Stream 9, >

[ovs-dev] [PATCH v3] Add monitor_cond_since support

2021-11-20 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 231 --- tests/ovsdb-idl.at | 2 +- 2 files changed

[ovs-dev] [PATCH v2] [python] Add monitor_cond_since support

2021-11-02 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 55 +++- 1 file changed, 44 insertions(+), 11 deletions

[ovs-dev] [PATCH 0/1] [python] Add monitor_cond_since support

2021-11-02 Thread Terry Wilson
I added monitor_cond_since / update3 support to the python IDL. I think ultimately it would be good to refactor a lot of the code to be a little more ovsdb_cs-like, but I'd rather come back and do that without also adding features. Terry Wilson (1): [python] Add monitor_cond_since support

[ovs-dev] [PATCH] [python] Add monitor_cond_since support

2021-11-02 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 60 ++-- 1 file changed, 47 insertions(+), 13 deletions

Re: [ovs-dev] [PATCH v3 1/2] socket-util: split inet_open_active function and use connect_ex

2021-10-27 Thread Terry Wilson
dress) > +if sock is None: > +return family, sock > +error = inet_connect_active(sock, address, family, dscp) > +if error: > +return error, None > +return 0, sock > > > def get_exception_errno(e): > -- > 2.31.1 > Tested against neutron "OverSsl" tests, and everything worked as it should. Acked-by: Terry Wilson Tested-by: Terry Wilson ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Re: [ovs-dev] [PATCH v3 2/2] python: replace pyOpenSSL with ssl

2021-10-27 Thread Terry Wilson
On Mon, Oct 25, 2021 at 8:46 AM Timothy Redaelli wrote: > > Currently, pyOpenSSL is half-deprecated upstream and so it's removed on > some distributions (for example on CentOS Stream 9, > https://issues.redhat.com/browse/CS-336), but since OVS only > supports Python 3 it's possible to replace

[ovs-dev] [PATCH v2] python: idl: Avoid pre-allocating column defaults

2021-11-05 Thread Terry Wilson
' fields set, this saves around 300MB of memory. One could argue that if values are not going to change from their defaults, then users should not be monitoring those columns, but it's also probably good to not waste memory even if user code is sub-optimal. Signed-off-by: Terry Wilson --- python

Re: [ovs-dev] [PATCH v2] Backup and remove existing DB when joining cluster

2021-11-05 Thread Terry Wilson
On Fri, Nov 5, 2021 at 6:07 AM Dumitru Ceara wrote: > > On 10/20/21 10:56 PM, Terry Wilson wrote: > > ovsdb-tool join-cluster requires a remote addr, so the existing > > code that tried to join a cluster without it when there was an > > existing $DB_FILE would fail

Re: [ovs-dev] [PATCH] [python] Avoid pre-allocating column defaults

2021-11-05 Thread Terry Wilson
Thanks for the review! On Fri, Nov 5, 2021 at 5:43 AM Dumitru Ceara wrote: > > Hi Terry, > > Nit: I'd prefix the commit subject line with "python: idl: ". > > On 10/12/21 9:53 PM, Terry Wilson wrote: > > Many python implementations pre-allocate space for m

[ovs-dev] [PATCH v2] Backup and remove existing DB when joining cluster

2021-11-05 Thread Terry Wilson
continuing to join the cluster. Signed-off-by: Terry Wilson --- utilities/ovs-lib.in | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 3eda01d3c..13477a6a9 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in

Re: [ovs-dev] [PATCH v2] [python] Add monitor_cond_since support

2021-11-04 Thread Terry Wilson
On Wed, Nov 3, 2021, 11:22 AM Ilya Maximets wrote: > On 11/3/21 01:36, Terry Wilson wrote: > > Add support for monitor_cond_since / update3 to python-ovs to > > allow more efficient reconnections when connecting to clustered > > OVSDB servers. > > >

Re: [ovs-dev] [PATCH v4 2/2] python: replace pyOpenSSL with ssl

2021-11-01 Thread Terry Wilson
Acked-by: Terry Wilson Tested-by: Terry Wilson On Fri, Oct 29, 2021 at 6:12 PM Timothy Redaelli wrote: > > Currently, pyOpenSSL is half-deprecated upstream and so it's removed on > some distributions (for example on CentOS Stream 9, > https://issues.redhat.com/browse/CS-336), b

[ovs-dev] [PATCH 0/1] python: Backport cooperative_yield addition

2021-12-02 Thread Terry Wilson
excpet the NEWS file. Terry Wilson (1): python: Add cooperative_yield() API method to Idl. NEWS | 6 ++ python/ovs/db/idl.py | 11 +++ 2 files changed, 17 insertions(+) -- 2.31.1 ___ dev mailing list d...@openvswitch.org

[ovs-dev] [PATCH 1/1] python: Add cooperative_yield() API method to Idl.

2021-12-02 Thread Terry Wilson
that defaults to doing nothing, but can be overridden to yield as needed. Signed-off-by: Terry Wilson (cherry picked from commit d28c5ca57650d6866453d0adb9a2e048cda21a86) --- NEWS | 6 ++ python/ovs/db/idl.py | 11 +++ 2 files changed, 17 insertions(+) diff --git

Re: [ovs-dev] [PATCH 1/1] python: Add cooperative_yield() API method to Idl.

2021-12-02 Thread Terry Wilson
On Thu, Dec 2, 2021 at 2:38 PM 0-day Robot wrote: > > Bleep bloop. Greetings Terry Wilson, I am a robot and I have tried out your > patch. > Thanks for your contribution. > > I encountered some error that I wasn't expecting. See the details below. > > > git-a

[ovs-dev] [PATCH v4] python: Add monitor_cond_since support

2021-12-01 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 245 --- tests/ovsdb-idl.at | 2 +- 2 files changed

Re: [ovs-dev] [PATCH v3] Add monitor_cond_since support

2021-12-01 Thread Terry Wilson
On Fri, Nov 26, 2021 at 5:38 AM Dumitru Ceara wrote: > Nit: To be consistent with the other ifs below we should probably add > this comment: > > # Database contents changed. Will do. > > +# If 'found' is false, clear table rows for new > > dump > > +

  1   2   >