[Asterisk-code-review] DNS: Need to use the same serializer for a pjproject SIP tra... (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Wed Jun 10 18:24:18 CDT 2015


Richard Mudgett has uploaded a new patch set (#2).

Change subject: DNS: Need to use the same serializer for a pjproject SIP transaction.
......................................................................

DNS: Need to use the same serializer for a pjproject SIP transaction.

All send/receive processing for a SIP transaction needs to be done under
the same threadpool serializer to prevent reentrancy problems inside
pjproject when using an external DNS resolver to process messages for the
transaction.

* Add threadpool API call to get the current serializer associated with
the worker thread.

* Pick a serializer from a pool of default serializers if the caller of
res_pjsip.c:ast_sip_push_task() does not provide one.

This is a simple way to ensure that all outgoing SIP request messages are
processed under a serializer.  Otherwise, any place where a pushed task is
done that would result in an outgoing out-of-dialog request would need to
be modified to supply a serializer.  Serializers from the default
serializer pool are picked in a round robin sequence for simplicity.

A side effect is that the default serializer pool will limit the growth of
the thread pool from random tasks.  This is not necessarily a bad thing.

* Made pjsip_resolver.c use the requesting thread's serializer to execute
the async callback.

* Made pjsip_distributor.c save the thread's serializer name on the
outgoing request tdata struct so the response can be processed under the
same serializer.

ASTERISK-25115 #close
Reported by: John Bigelow

Change-Id: Iea71c16ce1132017b5791635e198b8c27973f40a
---
M include/asterisk/threadpool.h
M main/threadpool.c
M res/res_pjsip.c
M res/res_pjsip/pjsip_distributor.c
M res/res_pjsip/pjsip_resolver.c
5 files changed, 211 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/627/2
-- 
To view, visit https://gerrit.asterisk.org/627
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iea71c16ce1132017b5791635e198b8c27973f40a
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list