Hi,
I just noticed something weird when working with the lcr module. My setup has 5 gateways - 4 in group 1, one in group 2. The lcr-table has an entry for each group, both reacting on the same prefix. I am using load_gws_from_grp("1") to get a gateway for a target. This usually works fine.
If now all 4 gateways in group 1 ar disabled because the alive check failed, load_gws_from_grp("1") returns the gateway from group 2 (or other groups where the prefix from the lcr-table matches.
I would consider this a bug, since I explicitly requested gateways from a specific group.
Regards, Stefan
Stefan Prelle writes:
I just noticed something weird when working with the lcr module. My setup has 5 gateways - 4 in group 1, one in group 2. The lcr-table has an entry for each group, both reacting on the same prefix. I am using load_gws_from_grp("1") to get a gateway for a target. This usually works fine.
If now all 4 gateways in group 1 ar disabled because the alive check failed, load_gws_from_grp("1") returns the gateway from group 2 (or other groups where the prefix from the lcr-table matches.
I would consider this a bug, since I explicitly requested gateways from a specific group.
stefan,
i was not able to reproduce this. i have
# kamctl fifo lcr_gw_dump GW:: GRP_ID=8 IP_ADD=192.98.101.11 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=0 TAG= WEIGHT=1 FLAGS=35 PING=0 GW:: GRP_ID=8 IP_ADD=192.98.101.12 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=0 TAG= WEIGHT=1 FLAGS=35 PING=0 GW:: GRP_ID=8 IP_ADD=192.98.101.13 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=0 TAG= WEIGHT=1 FLAGS=35 PING=0 GW:: GRP_ID=8 IP_ADD=192.98.101.14 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=0 TAG= WEIGHT=1 FLAGS=35 PING=0 GW:: GRP_ID=9 IP_ADD=192.98.101.21 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=0 TAG= WEIGHT=1 FLAGS=35 PING=0
# kamctl fifo lcr_lcr_dump RULE:: PREFIX=0 FROM_URI= GRP_ID=9 PRIORITY=1 RULE:: PREFIX=0 FROM_URI= GRP_ID=8 PRIORITY=1 PREFIX_LENS:: PREFIX_LEN=1
then in load_gws_from_grp i changed the DBG to ERR:
LM_ERR("added matched_gws[%d]=[%u, %u, %u, %u]\n", gw_index, next_index, 0, 1, matched_gws[gw_index].weight);
when i call load_gws_from_grp("8") i get:
Mar 10 04:56:09 taimen /usr/sbin/kamailio[12199]: ERROR:lcr:load_gws_from_grp: added matched_gws[0]=[1, 0, 1, 1364086043] Mar 10 04:56:09 taimen /usr/sbin/kamailio[12199]: ERROR:lcr:load_gws_from_grp: added matched_gws[1]=[4, 0, 1, 85553043] Mar 10 04:56:09 taimen /usr/sbin/kamailio[12199]: ERROR:lcr:load_gws_from_grp: added matched_gws[2]=[3, 0, 1, 1947781210] Mar 10 04:56:09 taimen /usr/sbin/kamailio[12199]: ERROR:lcr:load_gws_from_grp: added matched_gws[3]=[2, 0, 1, 1232419718]
i.e., that is the four gws from grp_id=8.
try a similar debug with your setup.
-- juha
*cough* *clear throat* *look abashed*
Am Dienstag, den 10.03.2009, 05:02 +0200 schrieb Juha Heinanen:
try a similar debug with your setup.
Found the problem: It exists between chair and computer.
Just modified the source like you requested to produce the output and wondered why it did not show up. Then found out that the program flow in the config file was not as I expected, so that I did call load_gws instead of load_gws_from_grp - which perfectly explains what I noticed.
I don't know why I did not see that yesterday. Sorry for the misinformation.
Cheers, Stefan
Stefan Prelle writes:
I don't know why I did not see that yesterday. Sorry for the misinformation.
no problem, while testing, i noticed that load_gws_from_grp does not exclude dead gws. i people don't object i would like to fix it as a bug in 1.5.
-- juha
Am Dienstag, den 10.03.2009, 10:10 +0200 schrieb Juha Heinanen:
Stefan Prelle writes:
I don't know why I did not see that yesterday. Sorry for the misinformation.
no problem, while testing, i noticed that load_gws_from_grp does not exclude dead gws. i people don't object i would like to fix it as a bug in 1.5.
Oh, please. My whole idea is based upon that functionality. :)
Stefan
stefan,
i would like to add, that load_gws_from_grp does not care about the prefix nor if a gw in the group is currently declared dead.
the latter could be considered a bug, i.e., it should skip dead gws. liveness test feature was not added by me and i overlooked this when i applied the patch.
-- juha
Hi Juha,
Am Dienstag, den 10.03.2009, 05:09 +0200 schrieb Juha Heinanen:
stefan,
i would like to add, that load_gws_from_grp does not care about the prefix nor if a gw in the group is currently declared dead.
the latter could be considered a bug, i.e., it should skip dead gws. liveness test feature was not added by me and i overlooked this when i applied the patch.
I tried this on our live system and noticed a shift in the traffic distribution. From what I figured this is not related to liveness tests. load_gws_from_grp definetly returned gateways from another group.
Formerly I used the openser-1.3.2, now I upgraded to kamailio-1.5.0. The entries in the database (of course the tables have been upgraded) of lcr and gw are still the same, so I guess something must have changed.
I see if I can strip that down to an easier example that reproduces the effect.
Regards, Stefan
On Tuesday 10 March 2009, Stefan Prelle wrote:
i would like to add, that load_gws_from_grp does not care about the prefix nor if a gw in the group is currently declared dead.
the latter could be considered a bug, i.e., it should skip dead gws. liveness test feature was not added by me and i overlooked this when i applied the patch.
I tried this on our live system and noticed a shift in the traffic distribution. From what I figured this is not related to liveness tests. load_gws_from_grp definetly returned gateways from another group.
Formerly I used the openser-1.3.2, now I upgraded to kamailio-1.5.0. The entries in the database (of course the tables have been upgraded) of lcr and gw are still the same, so I guess something must have changed.
I see if I can strip that down to an easier example that reproduces the effect.
Hi Stefan!
Can you perhaps add some details what exactly has changed? E.g. is it not equally distributed anymore and one GW get more traffic than the others? Or does it ignore some gateways completely?
Cheers,
Henning
Hi Henning,
Am Mittwoch, den 11.03.2009, 18:06 +0100 schrieb Henning Westerholt:
Can you perhaps add some details what exactly has changed? E.g. is it not equally distributed anymore and one GW get more traffic than the others? Or does it ignore some gateways completely?
As I already wrote: The problem existed between chair and monitor.
I did not notice that between openser-1.3.2 and kamailio-1.5 the load_gws(<grp>) was renamed to load_gws_from_grp(<grp>"), while the original syntax was still valid but with a different meaning.
So I got other gateways than I requested, but that was not related to the liveness checks.
Regards, Stefan
On Thursday 12 March 2009, Stefan Prelle wrote:
As I already wrote: The problem existed between chair and monitor.
Hi Stefan,
ok, then i've had also a similar problem reading this thread.. ;-)
Cheers,
Henning