Fix a race condition on nameserver reconfiguration.
commitf78793879d0f8cda54303f40337a7f439423b54a
authorNick Mathewson <nickm@torproject.org>
Wed, 28 Jan 2009 18:26:20 +0000 (28 18:26 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 28 Jan 2009 18:26:20 +0000 (28 18:26 +0000)
tree335726c161f056643fb4c9f375c16faac528e6b2
parente06de61d84e3c0fc152edeb622246baeb637874a
Fix a race condition on nameserver reconfiguration.

This resolves bug 526, wherein we would crash if the following
events occurred in this order:
  A: We're an OR, and one of our nameservers goes down.
  B: We launch a probe to it to see if it's up again. (We do this hourly
     in steady-state.)
  C: Before the probe finishes, we reconfigure our nameservers,
     usually because we got a SIGHUP and the resolve.conf file changed.
  D: The probe reply comes back, or times out. (There is a five-second
     window for this, after B has happens).

IOW, if one of our nameservers is down and our nameserver
configuration has changed, there were 5 seconds per hour where HUPing
the server was unsafe.

Bugfix on 0.1.2.1-alpha.  Too obscure to backport.

svn:r18306
ChangeLog
src/or/eventdns.c