[OpenSER-Devel] need advice for avp lock

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Oct 24 18:00:49 CEST 2007


Hi Di-Shi,

But what type of TM callback are you using?

Di-Shi Sun wrote:
> Hi Bogdan,
>
> We use tm callback function ospTmcbFunc defined in module/osp/tm.c. It reads
> a set of AVPs and creates some OSP internal data structures. Then starts
> another thread to connect the OSP server. It worked fine except the race
> condition. Do you recommend do it in onreply route block?
>
> Thanks,
>
> Di-Shi Sun.
>
> ----- Original Message ----- 
> From: "Bogdan-Andrei Iancu" <bogdan at voice-system.ro>
> To: "Di-Shi Sun" <di-shi at transnexus.com>
> Cc: "Henning Westerholt" <henning.westerholt at 1und1.de>; <devel at openser.org>;
> "Support of TransNexus" <support at transnexus.com>
> Sent: Tuesday, October 23, 2007 10:51 PM
> Subject: Re: [OpenSER-Devel] need advice for avp lock
>
>
>   
>> Hi Di-Shi,
>>
>> So you access this info from a callback and not from onreply
>> route...What callback it is?
>>
>> Regards,
>> Bogdan
>>
>> Di-Shi Sun wrote:
>>     
>>> Hi Henning,
>>>
>>> Our case is like this:
>>> 1. Our tm call back function was triggered by out 180 and 200. The
>>>       
> interval
>   
>>> between 180 and 200 was so short.
>>> 2. The call back function accessed a set of AVPs and set a flag (in AVP
>>> value) for every AVP to mark these AVPs were comsumed. This flag made
>>>       
> these
>   
>>> AVPs to be used only once. Since the call back function was called twice
>>>       
> at
>   
>>> almost the same time, the race condition happned that some AVPs were
>>>       
> used
>   
>>> twice.
>>>
>>> According the source code, we believe that USE_PTHREAD_MUTEX lock set is
>>> thread safe and can be used for AVP. But the default lock set is
>>>       
> FAST_LOCK.
>   
>>> We do not know if it can be used for AVP.
>>>
>>> Regards,
>>>
>>> Di-Shi Sun.
>>>
>>> ----- Original Message ----- 
>>> From: "Henning Westerholt" <henning.westerholt at 1und1.de>
>>> To: "Di-Shi Sun" <di-shi at transnexus.com>
>>> Cc: <devel at openser.org>; "Support of TransNexus"
>>>       
> <support at transnexus.com>
>   
>>> Sent: Tuesday, October 23, 2007 9:35 PM
>>> Subject: Re: [OpenSER-Devel] need advice for avp lock
>>>
>>>
>>>
>>>       
>>>> On Thursday 18 October 2007, Di-Shi Sun wrote:
>>>>
>>>>         
>>>>> Hi Henning,
>>>>>
>>>>> I believe we met the same problem. For us, only one flag in an AVP (5
>>>>>
>>>>>           
>>> AVPs
>>>
>>>       
>>>>> for a call) is set and the logic is simple. So, we did not meet a
>>>>>           
> crash
>   
>>>>> condition. It happened 17 times in a 1M call test at 50 cps.
>>>>>
>>>>> Klaus Darilion suggested we read the tm code for the AVP lock. I will
>>>>>
>>>>>           
>>> study
>>>
>>>       
>>>>> it.
>>>>>
>>>>>           
>>>> I've studied this code too, but i found nothing helpful. What kind of
>>>>
>>>>         
>>> error
>>>
>>>       
>>>> you've observed? In your first mail you spoke about a race condition,
>>>>         
> is
>   
>>> the
>>>
>>>       
>>>> wrong AVP value accessed?
>>>>
>>>> Cheers,
>>>>
>>>> Henning
>>>>
>>>>
>>>>
>>>>         
>>>
>>> _______________________________________________
>>> Devel mailing list
>>> Devel at openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/devel
>>>
>>>
>>>       
>>
>>     
>
>
>
>   




More information about the Devel mailing list