bind9 doesn't close extra fds

Mark_Andrews at isc.org Mark_Andrews at isc.org
Tue Aug 27 22:52:58 UTC 2002


> 
> > bind8 loops for over a minute on modern hardware for which
> > _SC_OPEN_MAX is often 16777216.
> 
> That *is* quite large...
> 
> > the bind9 behaviour was minimalistic.
> 
> But is it right?   In my experience, programs are expected to close 
> unnecessary file descriptors when they daemonize.  Perhaps this 
> behavior could be made conditional for the "modern hardware" you 
> mentioned.
> 
> Rudy
> 

	Unless there is a bug in the caller (or its callers) there
	won't be unnecessary file descriptors open in the first
	place.  Apart from stderr named only uses descriptors that
	it opens itself.  The worst that can happen is that it is
	starved of descriptors.

	You also need to remember that the practice of closing
	descriptors started back in the days when there were only
	16 file descriptors available total.  There also wasn't
	close on exec available then so it was necessary to close
	descriptors that you didn't need.

	Mark
--
Mark Andrews, Internet Software Consortium
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: Mark.Andrews at isc.org


More information about the bind-workers mailing list