set minimum initital sip t1 timer to 1000ms to work around race condition on retry timer firing before all the things that are supposed to be handled by the timer are set. The base resolution on this timer is 500ms, so doubling up makes sure we always hit the initial retry timer on the next run, where everything should be set. The side effect was, 1/2 the time on a request that did not get immediate response, the timer would be fired and cleared, but the action (sending retry) was never done, and a new timer was not set, causing the request to just sit zombied and never retry. A better solution would be to find and correct the race condition so the timer is never set to early and we never hit this condition.

This commit is contained in:
Michael Jerris 2010-11-03 13:57:59 -04:00
parent 2043d5a671
commit 20c2740c64
2 changed files with 7 additions and 4 deletions

View File

@ -1 +1 @@
Wed Nov 3 11:46:27 EDT 2010
Wed Nov 3 13:53:34 EDT 2010

View File

@ -8176,9 +8176,12 @@ outgoing_send(nta_outgoing_t *orq, int retransmit)
if (orq->orq_method == sip_method_ack)
;
else if (!orq->orq_reliable)
outgoing_set_timer(orq, agent->sa_t1); /* Timer A/E */
else if (orq->orq_try_tcp_instead && !tport_is_connected(tp))
else if (!orq->orq_reliable) {
/* race condition on initial t1 timer timeout, set minimum initial timeout to 1000ms */
unsigned t1_timer = agent->sa_t1;
if (t1_timer < 1000) t1_timer = 1000;
outgoing_set_timer(orq, t1_timer); /* Timer A/E */
} else if (orq->orq_try_tcp_instead && !tport_is_connected(tp))
outgoing_set_timer(orq, agent->sa_t4); /* Timer N3 */
}