v3.0.x: rlm_rest and redundant load-balance
Hi, i'm trying to use rlm_rest module under redundant load-balance section like this: accounting { update control { &REST-HTTP- Header = "X-Header: XXXX" } redundant-load-balance { rest1 rest2 } } But doesn't work as expected because if the first node (rest1) failed the second REST request is sent without REST-HTTP-HEADER defined (in this example without X-Header). If rest1 is up&running HTTP request contains X-Header correctly. I think that the problem is this: https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/src/modules/rlm_... is there a reason because there attribute is removed instead of simply to use it? So, fr_cursor_current instead of fr_cursor_remove? Could it be correct to leave to the user the clean of this attribute? -- geaaru
On Dec 13, 2019, at 12:05 PM, Geaaru <geaaru@gmail.com> wrote:
Hi, i'm trying to use rlm_rest module under redundant load-balance section like this: accounting { update control { &REST-HTTP- Header = "X-Header: XXXX" } redundant-load-balance { rest1 rest2 } } But doesn't work as expected because if the first node (rest1) failed the second REST request is sent without REST-HTTP-HEADER defined (in this example without X-Header). If rest1 is up&running HTTP request contains X-Header correctly. I think that the problem is this: https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/src/modules/rlm_... is there a reason because there attribute is removed instead of simply to use it?
The idea is that the headers apply only to one rest module. i.e. you may be calling two different rest modules, with different headers.
So, fr_cursor_current instead of fr_cursor_remove? Could it be correct to leave to the user the clean of this attribute?
Maybe. For now, it's simple to just re-add the header. The rlm_rest module could arguably have an option to remove (or not) the headers. Alan DeKok.
But how you can do this inside redundant-load-balance block? It seems out of scope to reset REST-HTTP-HEADER until all available modules (inside the redundant-load-balance) are executed.I know that single module doesn't know that is inside of redundant-load-balance section but it seems wrong from my side do this because this means something like this: redundant-load-balance { rest1 update control { &REST-HTTP-Header = "X- Header: XXX" } rest2 } that is wrong as syntax. I will try to add an option for this, probably is the more easy way to use it. Daniele On Fri, 2019-12-13 at 13:08 -0500, Alan DeKok wrote:
On Dec 13, 2019, at 12:05 PM, Geaaru <geaaru@gmail.com> wrote: Hi,i'm trying to use rlm_rest module under redundant load-balance sectionlike this: accounting { update control { &REST-HTTP-Header = "X-Header: XXXX" } redundant-load-balance { rest1 rest2 } }But doesn't work as expected because if the first node (rest1) failedthe second REST request is sent without REST-HTTP-HEADER defined (inthis example without X-Header). If rest1 is up&running HTTP requestcontains X-Header correctly.I think that the problem is this: https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/src/modules/rlm_... is there a reason because there attribute is removed instead of simplyto use it?
The idea is that the headers apply only to one rest module. i.e. you may be calling two different rest modules, with different headers.
So, fr_cursor_current instead of fr_cursor_remove?Could it be correct to leave to the user the clean of this attribute?
Maybe. For now, it's simple to just re-add the header. The rlm_rest module could arguably have an option to remove (or not) the headers. Alan DeKok.
On Dec 13, 2019, at 1:38 PM, Geaaru <geaaru@gmail.com> wrote:
But how you can do this inside redundant-load-balance block? It seems out of scope to reset REST-HTTP-HEADER until all available modules (inside the redundant-load-balance) are executed.I know that single module doesn't know that is inside of redundant-load-balance section but it seems wrong from my side do this because this means something like this: redundant-load-balance { rest1 update control { &REST-HTTP-Header = "X- Header: XXX" } rest2 } that is wrong as syntax.
You could do: redundant-load-balance { group { add header rest1 } group { add header rest2 } }
I will try to add an option for this, probably is the more easy way to use it.
Yes. Or, we could add an option which would remove the header *only* if the module succeeded. Alan DeKok.
Ok, thanks. On Fri, Dec 13, 2019, 19:57 Alan DeKok <aland@deployingradius.com> wrote:
On Dec 13, 2019, at 1:38 PM, Geaaru <geaaru@gmail.com> wrote:
But how you can do this inside redundant-load-balance block? It seems out of scope to reset REST-HTTP-HEADER until all available modules (inside the redundant-load-balance) are executed.I know that single module doesn't know that is inside of redundant-load-balance section but it seems wrong from my side do this because this means something like this: redundant-load-balance { rest1 update control { &REST-HTTP-Header = "X- Header: XXX" } rest2 } that is wrong as syntax.
You could do:
redundant-load-balance { group { add header rest1 } group { add header rest2 } }
I will try to add an option for this, probably is the more easy way to use it.
Yes.
Or, we could add an option which would remove the header *only* if the module succeeded.
Alan DeKok.
participants (2)
-
Alan DeKok -
Geaaru