[ntp:hackers] Correctly detecting interfaces
Brian Utterback
brian.utterback at oracle.com
Sat Jul 13 00:12:40 UTC 2013
On 07/12/13 14:40, Hal Murray wrote:
> brian.utterback at oracle.com said:
>> Rather than rewrite every instance of calling ioctl to include a test for
>> EINTR and loop to try again, I wrote a new function (isc_ioctl) which is
>> simply a wrapper function around the regular ioctl call. This wrapper
>> function incorporates such a test and loop. I used a "three strikes and
>> you're out" rule, but any number could be used. Probably two tries is
>> really enough, since the interrupt could come anytime after the ioctl is
>> called the first time, but a second failure would imply that the call is
>> taking more than one second to complete and it might never complete without
>> an interrupt if that state is persistent.
> Where did one second come from?
>
> I could easily imagine a burst of failures caused by a burst of packets. All
> it would take would be a nasty combination of router (say WiFi) that happened
> to get the timing just right to match a CPU with the right speed.
>
>
Correct, if you are using interrupt driven I/O, then this is true. I am
not sure that we always use interrupt driven I/O however. The one second
comes from the fact that we also have a once per second SIGALRM
interrupt going. This is probably less of a problem in the BIND distro
than the NTP distro.
--
blu
Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. - Martin Golding
-----------------------------------------------------------------------|
Brian Utterback - Solaris RPE, Oracle Corporation.
Ph:603-262-3916, Em:brian.utterback at oracle.com
More information about the hackers
mailing list