Re: [sipX-dev] DNS query problem
I think there is a lot of way to cause this problem:
In a dial plan, I configure that all calls with prefix 0 will forward to
sip.mydomian.com.
So the authserver, before forwarding the message(the request URI is like INVITE
sip:082558998@xxxxxxxxxxxxxxxx), it must perform a DNS query to get the IP
address of sip.mydomain.com. This can be failed, the reason may be that no
entry for this domain in DNS server ,or the server is down for that moment.
This can cause the SipSrvLookup::servers() spend over one minute to return. So
the SipAaa::handleMessage() is blocked in this while, and it can not handle
other messages.
Because very message will go to authserver for authentication and authorization
handling, this single DNS qurey failure can cause the whole system stop
processing messages for over one minute.
>On Fri, 2007-04-13 at 20:34 +0800, tonyxiao wrote:
>> Hi all,here is a problem I met:
>> Before forwarding the message, SIP server will perform a DNS query. In
>> SipSrvLookup::servers(), the query step is: UDP SRV-->TCP SRV-->TLS
>> SRV-->A.
>>
>> If any of the above step failed, it will try the next step,the worst
>> thing is that all these steps failed, so the function will take over
>> one minute to reach the end. During this minute, because the function
>> is blocked, the server can not handle other messages. Such thing
>> happened in my server, a invalid domain name can cause the server stop
>> working for over one minute.
>>
>> The reason is DNS query may take a long time, and the server is using
>> a blocking method to call this function. Does anyone met this problem?
>> I think we should create a new thread to perform DNS query, store the
>> results in cache, and the message processing thread should take this
>> result directly.
>
>It's been known as a theoretical problem for a long time, but DNS
>failure isn't very frequent in production systems. I think you're the
>first person to have run into this in practice.
>
>Can you describe what caused this problem for you? Especially if it
>allows one to re-create the problem at will.
>
>If this happened to you in a production system, could you file a but
>report on it in the SIPfoundry bug tracker?
>
>Thanks,
>
>Dale
>
>
>
>
= = = = = = = = = = = = = = = = = = = =
致
礼!
tonyxiao
quest1222@xxxxxxxx
2007-04-15