[sr-dev] AVPs in replies?

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Dec 10 11:41:44 CET 2009


On Dec 10, 2009 at 12:23, Juha Heinanen <jh at tutpro.com> wrote:
> Andrei Pelinescu-Onciul writes:
> 
>  > I'll have a quick fix in the next few days (similar to k, but I'm
>  > thinking of going for read-only avps by default and a modparam to turn
>  > them r/w at the price of locking the reply route). In the long run
>  > we need a better fix.
> 
> andrei,
> 
> i'm also setting avps in onreply_route and thus have to set the r/w
> modparam.  will locking be more costly in sr than in k?  would it be
> possible to lock only those parts of onrely_route where avps are set?

It will be exactly the same as in k: the whole reply route executed
under lock. Whether is costly or not depends on what you do in the rely
route. If the reply route does not contain costly operations (e.g. DB)
and is just checking some parts of the message and setting avps, there
shouldn't be a noticeable difference from the performance point of view
(helped also by the fact that the probability of having 2 reply routes
for the same reply execute in parallel is quite low).
What I'm afraid is that executing the reply route under lock might
introduce some deadlocks (it is possible that some functions that are now
allowed to be executed from the onreply route would cause problems, I
haven't checked all of them).
The long term solution would be to lock only the avps and only when used,
but it requires lots of changes and testing and I'm not sure it would be
ready/good enough for 3.0.

Andrei



More information about the sr-dev mailing list