Re: contrib/spoa/python: A few doc typo and bug fixes

2020-12-08 Thread Gilchrist DADAGLO
No issue with backporting to 2.0. I just mentioned 2.2 as it's the last. Thanks. Gilchrist On Tue, Dec 8, 2020, 16:01 Christopher Faulet wrote: > Le 08/12/2020 à 15:37, Gilchrist Dadaglo a écrit : > > Hi Team, > > Please find here-after a few patches for SPOA python

[PATCH 8/8] BUG/MEDIUM: spoa/python: Fixing references to None

2020-12-08 Thread Gilchrist Dadaglo
As per https://docs.python.org/3/c-api/none.html, None has to be treated exactly like other objects for reference counting. So, when we use it, we need to INCREF and when we are done, DECREF --- contrib/spoa_server/ps_python.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 4/8] DOC/MINOR: spoa/python: Fixing typos in comments

2020-12-08 Thread Gilchrist Dadaglo
Fixing a missing letter in a comment --- contrib/spoa_server/ps_python.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/spoa_server/ps_python.c b/contrib/spoa_server/ps_python.c index 380d5b3..fbaa414 100644 --- a/contrib/spoa_server/ps_python.c +++

[PATCH 2/8] DOC/MINOR: spoa/python: Fixing typo in IP related error messages

2020-12-08 Thread Gilchrist Dadaglo
This commit fixes typos in the ps_python_set_var_ip* byte manipulation error messages --- contrib/spoa_server/ps_python.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/spoa_server/ps_python.c b/contrib/spoa_server/ps_python.c index 81bb932..ec97f30 100644 ---

[PATCH 6/8] BUG/MINOR: spoa/python: Cleanup ipaddress objects if initialization fails

2020-12-08 Thread Gilchrist Dadaglo
This change is to ensure objects from the ipaddress module are cleaned up when spoa module initialization fails. In general the interpreter would just crash, but in a code where import is conditional (try/except), then we would keep those objects around --- contrib/spoa_server/ps_python.c | 6

[PATCH 7/8] BUG/MEDIUM: spoa/python: Fixing PyObject_Call positional arguments

2020-12-08 Thread Gilchrist Dadaglo
As per https://docs.python.org/3/c-api/object.html#c.PyObject_Call, positional arguments should be an empty tuple when not used. Previously the code had a dictionary instead of tuple. This commit is to fix it and use tuple to avoid unexpected consequences --- contrib/spoa_server/ps_python.c | 10

[PATCH 3/8] DOC/MINOR: spoa/python: Rephrasing memory related error messages

2020-12-08 Thread Gilchrist Dadaglo
The old message "No more space left available" was redundant with "left available". This commit is to rephrase that sentence and make it more explicit we are talking about memory --- contrib/spoa_server/ps_python.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff

[PATCH 5/8] BUG/MINOR: spoa/python: Cleanup references for failed Module Addobject operations

2020-12-08 Thread Gilchrist Dadaglo
As per https://docs.python.org/3/c-api/module.html#c.PyModule_AddObject, references are stolen by the function only for success. We must do cleanup manually if there is a failure --- contrib/spoa_server/ps_python.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-)

[PATCH 1/8] BUG/MAJOR: spoa/python: Fixing return None

2020-12-08 Thread Gilchrist Dadaglo
As per https://docs.python.org/3/c-api/none.html, None requires to be incremented before being returned to prevent deallocating none --- contrib/spoa_server/ps_python.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/contrib/spoa_server/ps_python.c

contrib/spoa/python: A few doc typo and bug fixes

2020-12-08 Thread Gilchrist Dadaglo
to 2.2 (LTS)? Thanks Gilchrist

Re: [PATCH 1/6] MINOR: spoa: allow MAX_FRAME_SIZE override

2020-09-02 Thread Gilchrist DADAGLO
Thanks Christopher, Appreciate the fast merge. Gilchrist On Tue, Sep 1, 2020, 18:36 Christopher Faulet wrote: > Le 24/08/2020 à 21:21, gilchr...@dadaglo.com a écrit : > > From: Bertrand Jacquin > > > > MAX_FRAME_SIZE is forced to the default value of tune.bufsize, h

[PATCH 6/6] BUG/MEDIUM: spoa/python: Fix ipv4_address used instead of ipv6_address

2020-08-24 Thread gilchrist
From: Gilchrist Dadaglo Typo leads to checking the wrong object for memory issues --- contrib/spoa_server/ps_python.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/spoa_server/ps_python.c b/contrib/spoa_server/ps_python.c index 468ee43..b6f4ad1 100644 --- a/contrib

[PATCH 3/6] BUG/MINOR: spoa/python: Ensure ip address references are freed

2020-08-24 Thread gilchrist
From: Gilchrist Dadaglo IP addresses references passed in argument for ps_python are not freed after they have been used. Leading to a small chance of mem leak if a lot of ip addresses are passed around --- contrib/spoa_server/ps_python.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH 5/6] BUG/MINOR: spoa/python: Updating references to free in case of failure

2020-08-24 Thread gilchrist
From: Gilchrist Dadaglo When we encounter a failure, all previously borrowed references should be freed. Especially if the program is not failing immediately --- contrib/spoa_server/ps_python.c | 9 + 1 file changed, 9 insertions(+) diff --git a/contrib/spoa_server/ps_python.c b

[PATCH 4/6] BUG/MINOR: spoa/python: Do not free reference to NULL

2020-08-24 Thread gilchrist
From: Gilchrist Dadaglo As per https://docs.python.org/3/c-api/refcounting.html, Py_DECREF should not be called on NULL objects. --- contrib/spoa_server/ps_python.c | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/spoa_server/ps_python.c b/contrib/spoa_server/ps_python.c index c27387c

[PATCH 2/6] BUG/MAJOR: spoa/python: Fix unhandled python call leading to memory leak

2020-08-24 Thread gilchrist
From: Gilchrist Dadaglo The result from spoa evaluation of the user provided python code is never passed back to the main spoa process nor freed. Same for the keyword list passed. This results into the elements never freed by Python as reference count never goes down. https://docs.python.org/3

[PATCH 1/6] MINOR: spoa: allow MAX_FRAME_SIZE override

2020-08-24 Thread gilchrist
From: Bertrand Jacquin MAX_FRAME_SIZE is forced to the default value of tune.bufsize, however they don't necessarily have to be tight together. --- contrib/spoa_server/spoa.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/spoa_server/spoa.h b/contrib/spoa_server/spoa.h index

Re: [PATCH] MAJOR: contrib: porting spoa_server to support python3

2020-05-11 Thread Gilchrist DADAGLO
Hi, Thank you for the fast merge Willy and Thierry. I will keep this process in mind for any future contribution. Cheers, Gilchrist On Mon, May 11, 2020, 11:01 Willy Tarreau wrote: > On Mon, May 11, 2020 at 10:32:27AM +0200, Thierry Fournier wrote: > > Hi, thanks Willy, > >

Re: [PATCH] MAJOR: contrib: porting spoa_server to support python3

2020-05-06 Thread Gilchrist DADAGLO
I didn't do anything for that purpose. Gilchrist On Wed, May 6, 2020, 16:13 Илья Шипицин wrote: > How did you get "test result"? > Should we add automated test for that? For example, once a week > > On Wed, May 6, 2020, 5:28 PM Gilchrist Dadaglo wrote: > >>

[PATCH] MAJOR: contrib: porting spoa_server to support python3

2020-05-06 Thread Gilchrist Dadaglo
python 2 if python 3 is not available. + Start the service - diff --git a/haproxy/contrib/spoa_server/ps_python.c b/haproxy/contrib/spoa_server/ps_python.c index 0a9fbff..019d125 100644 --- a/haproxy/contrib/spoa_server/ps_python.c +++ b/haproxy/contrib/spoa_server/ps_python.c