[reSIProcate] An other Ares problem

Bjorn Andersson bjorn.andersson at aastra.com
Wed Feb 19 02:41:43 CST 2014


Hi,
We tried out 1.9 multi-threaded and got 100% load in the dns thread. It
turned out that ares_timeout will not touch the tv struct if no work is
on going. This means that the timeout is calculated on comletely random
data.
This patch fixes the problem, I'm not sure about a suitable time though.

Best Regards,
Björn A.

*** AresDns.cxx.orig    2014-02-19 09:34:23.000000000 +0100
--- AresDns.cxx 2014-02-19 09:35:24.000000000 +0100
*************** AresDns::makeRawResult(void *arg, int st
*** 598,604 ****
  unsigned int
  AresDns::getTimeTillNextProcessMS()
  {
!    struct timeval tv;
     ares_timeout(mChannel, NULL, &tv);
     return tv.tv_sec*1000 + tv.tv_usec / 1000;
  }
--- 598,604 ----
  unsigned int
  AresDns::getTimeTillNextProcessMS()
  {
!    struct timeval tv = {30,0};
     ares_timeout(mChannel, NULL, &tv);
     return tv.tv_sec*1000 + tv.tv_usec / 1000;
  }






More information about the resiprocate-devel mailing list