2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

address some possible shutdown races in xfrin

there were two failures during observed in testing, both occurring
when 'rndc halt' was run rather than 'rndc stop' - the latter dumps
zone contents to disk and presumably introduced enough delay to
prevent the races:

- a failure when the zone was shut down and called dns_xfrin_detach()
  before the xfrin had finished connecting; the connect timeout
  terminated without detaching its handle
- a failure when the tcpdns socket timer fired after the outerhandle
  had already been cleared.

this commit incidentally addresses a failure observed in mutexatomic
due to a variable having been initialized incorrectly.
This commit is contained in:
Evan Hunt
2020-11-09 12:33:37 -08:00
parent ce58a149ce
commit e011521ef1
3 changed files with 7 additions and 4 deletions

View File

@@ -98,7 +98,9 @@ dnstcp_readtimeout(uv_timer_t *timer) {
REQUIRE(sock->tid == isc_nm_tid());
/* Close the TCP connection; its closure should fire ours. */
isc_nmhandle_detach(&sock->outerhandle);
if (sock->outerhandle != NULL) {
isc_nmhandle_detach(&sock->outerhandle);
}
}
/*