Update:
The root cause of the DNS servers returning a SERVFAIL seems to be because they
are not able to access the root name servers. ("no_domain." returns a SERVFAIL,
while "no_domain.com." correctly returns a NXDOMAIN - thanks to Lee Davis for
testing this). I have had chance to try this out on a local Windows DNS server,
and both queries return NXDOMAIN, as expected.
Nonetheless there are valid scenarios where the DNS servers can return
SERVFAILs/hang up. So, here's my proposed solution:
- Thread out the whole DNS lookup part of the code in SipSrvLookUp::servers().
This thread will be responsible for the whole "res_query()" blocking part of
the code.
- Use shared memory, mutex, and polling to test whether the query has completed
and get the results back.
- Set a hard time of 5secs for the thread to finish the query, or we will stop
polling, kill the thread, and continue.
Pros&Cons
- All the new/delete, polling, spawning and shutting down the thread will kill
the performance for all legit DNS queries
- This code change is probably of no use in the long run (once the proxy/stack
is multi-threaded)
+ We can be sure that no matter what happens, the proxy will not get blocked
for more than 5 secs.
I would like comments from the list before I go ahead with this.
Thanks,
Arjun
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev