[OpenSIPS-Users] Async event_route and cachdb_redis

SamyGo govoiper at gmail.com
Thu Mar 2 11:53:55 EST 2017


Hi Razvan,

I actually gave up that idea and continued with life, however, turns out on
another task I got face-to-face with exactly the same problem but with
memcache here instead of redis.

The version Im using now is 2.2.2.

Apparently the documentation on this module is missing "limitations", I was
unable to use redis, memcache, rest_post, hence its just an async-event way
of printing xlog lines.

Please note that if I call this event_route without 'async' atleast
memcache ops work, which are no help since ts invoked inside the processing
of the same call, this may even take more toll on the CPU usage since we're
now raising event to do the same thing that can be done with just an
ordinary route.

Example:

if(save("location"))
    route(DO_SOMETHING);

With events triggered w/o async this looks like.

save("location");
...
event_route[E_UL_CONTACT_INSERT]{
      # everything route[DO_SOMETHING] could do plus events-overhead, still
some limitations
}

With event route in async mode

event_route[E_UL_CONTACT_INSERT,async]{
       # route[DO_SOMETHING] with xlog capability only. :D
}

Thanks,
Sammy.

On Wed, Jun 22, 2016 at 2:45 PM, SamyGo <govoiper at gmail.com> wrote:

> Thanks Razvan for dedicating time for me.
> You can find the output from the given command here: http://pastebin.com/
> fh11mkXS
>
>
>
> On Wed, Jun 22, 2016 at 12:48 PM, Răzvan Crainea <razvan at opensips.org>
> wrote:
>
>> Could you run the 'opensipsctl trap' command and paste the output on
>> pastebin.
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Solutionswww.opensips-solutions.com
>>
>> On 06/22/2016 07:39 PM, SamyGo wrote:
>>
>> Yes correct. Async event route even stops to be executed.
>> On Jun 22, 2016 12:37, "Răzvan Crainea" <razvan at opensips.org> wrote:
>>
>>> So the patch doesn't do anything but stops triggering the event?
>>>
>>> Regards,
>>>
>>> Răzvan Crainea
>>> OpenSIPS Solutionswww.opensips-solutions.com
>>>
>>> On 06/22/2016 07:07 PM, SamyGo wrote:
>>>
>>> Yeah it only happens at startup. If I start opensips in debug_mode=yes
>>> then the error prints for infinite time.
>>>
>>> With your patch; putting "async" doesn't even call the event route. If I
>>> remove async attribute then it works just like before the patch.
>>>
>>> Regards,
>>> Sammy
>>>
>>>
>>> On Wed, Jun 22, 2016 at 3:10 AM, Răzvan Crainea < <razvan at opensips.org>
>>> razvan at opensips.org> wrote:
>>>
>>>> Hi, Sammy!
>>>>
>>>> Does this happen only at startime, or happens during runtime too?
>>>>
>>>> Regards,
>>>>
>>>> Răzvan Crainea
>>>> OpenSIPS Solutionswww.opensips-solutions.com
>>>>
>>>> On 06/21/2016 10:57 PM, SamyGo wrote:
>>>>
>>>> Hi ,
>>>>
>>>> After recompiling , when I start opensips it gives this error:
>>>>
>>>> ERROR:event_route:event_route_handler: invalid receive sock info
>>>>
>>>> The two event routes I have are these:
>>>>
>>>> event_route[E_UL_CONTACT_INSERT,async] {
>>>>                 fetch_event_params("aor=$avp(
>>>> aor);address=$avp(address);received=$avp(received)");
>>>> ....
>>>>                  cache_raw_query("redis:group1","HSET
>>>> GLOBAL_USER_LOCATION $avp(aor) $var(my_value1)");
>>>>
>>>> }
>>>>
>>>> event_route[E_UL_AOR_DELETE,async] {
>>>>                 fetch_event_params("aor=$avp(aor)");
>>>> ...
>>>>                 cache_raw_query("redis:group1","DEL
>>>> GLOBAL_USER_LOCATION $avp(aor)");
>>>>
>>>> }
>>>>
>>>>
>>>> Some Xlog lines in both of these routes, nothing seems to be printed
>>>> now, no error , no cache data modifications executing..
>>>>
>>>> I'll see in further detail what is happening and if I find anything
>>>> abnormal will reply.
>>>>
>>>>
>>>> Regards.
>>>> Sammy
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, Jun 21, 2016 at 3:40 AM, Răzvan Crainea < <razvan at opensips.org>
>>>> razvan at opensips.org> wrote:
>>>>
>>>>> Hi, Sammy!
>>>>>
>>>>> Could you try this patch:
>>>>>
>>>>> https://gist.github.com/razvancrainea/9d239c82474bb0f1c403b6459dbdb647
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Răzvan Crainea
>>>>> OpenSIPS Solutionswww.opensips-solutions.com
>>>>>
>>>>> On 06/19/2016 08:56 PM, SamyGo wrote:
>>>>>
>>>>> Hi,
>>>>> I'm seeing errors from cachedb_redis module when called in an event
>>>>> route in async mode.
>>>>>
>>>>> event_route[E_UL_CONTACT_INSERT,async] {
>>>>> ...
>>>>> cache_raw_query("redis:group1","SET ABC");
>>>>> ..
>>>>>
>>>>> }
>>>>>
>>>>> OpenSIPS throws error stating that redis group1 unavailable
>>>>>
>>>>> DBG:core:cachedb_raw_query: from script [redis] - with grp [group1]
>>>>> ERROR:core:cachedb_raw_query: failed to get connection for grp name
>>>>> [group1]
>>>>>
>>>>> I tried same command in main route of reply route, all works normal.
>>>>> if I remove the "async" from the event_route definition it works in event
>>>>> route.
>>>>>
>>>>> Any logical reason why async route don't recognize the connections ?
>>>>>
>>>>> Tried with OpenSIPS 2.2 and 2.1 as well, same behavior.
>>>>>
>>>>>
>>>>> Regards,
>>>>> Sammy
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Users mailing list
>>>>> Users at lists.opensips.org
>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>> _______________________________________________
>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170302/9c2733f1/attachment-0001.html>


More information about the Users mailing list