diff options
author | Richard Mudgett <rmudgett@digium.com> | 2016-06-03 22:44:46 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-06-07 18:57:36 -0500 |
commit | 9c35f34301c15d1370623d6f8a59a25a723b59b6 (patch) | |
tree | 86a805bd08717d9ad312cd1862f2412b941b4e7b /tests | |
parent | 557333ea4c031d10bf52ceade79c32cbff801c0c (diff) |
res_pjsip_registrar.c: Eliminate rx REGISTER request race condition.
This patch fixes a race condition processing received REGISTER requests
and their retransmissions caused by REGISTER requests being processed by
two threads. The "sip_transaction Unable to register REGISTER transaction
(key exists)" message is a notable symptom of this issue.
This issue was more likely to happen before the pjsip/distributor
serializers were created. Instead of steps one and two below placing the
REGISTER messages into the same pjsip/distributor they were placed in
random pjsip/default serializers.
1) REGISTER requests come in and get placed on the pjsip/distributor
serializer.
2) Before the first request is processed a retransmission comes in and is
placed on the same pjsip/distributor serializer.
3) The first request goes up the pjsip stack and is then shunted off to
the pjsip/aor/<aor> serializer.
4) Before the first request is completed processing in the pjsip/aor/<aor>
serializer, the second request goes up the pjsip stack and is also shunted
off to the pjsip/aor/<aor> serializer.
5) The first request completes processing and sends out its response.
6) The second request completes processing and tries to send out its
response but pjlib complains that the REGISTER transaction key already
exists.
7) Sadness ensues.
* The race is eliminated by removing the pjsip/aor/<aor> serializer and
continuing the processing in the pjsip/distributor serializer. Now any
retransmissions queued in the pjsip/distributor serializer will be
processed after the first message is completely processed.
ASTERISK-26088 #close
Reported by: Richard Mudgett
Change-Id: I842d714346088bf717ea27437f1dd85bff0bab5a
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions