alarm() and 25 seconds

Felipe Gasper felipe at
Wed May 29 14:34:46 UTC 2019


	I’m noticing that libunbound will, if an alarm() is set for under 25 seconds, trap SIGALRM (or reset the alarm?), then time out after 24/25 seconds. Even if I set an alarm() of, say, 5 seconds, the timeout won’t happen until at least 25 seconds.

	If, though, I set alarm() for _over_ 25 seconds, there is no apparent timeout--or, it takes longer than I’m willing to wait.

	Does libunbound document its interactions with alarm() or other mechanisms that I could use to enforce a “master” query timeout? 25 seconds happens to be acceptable, but I’m a bit uncomfortable depending on this “feature” when it’s undocumented, inflexible, and I’m not even sure where it is in the libunbound code.

	(I’m trying to avoid async mode because I’m calling libunbound from Perl, and I’m unsure of how threading would interact with Perl, and forking is more overhead than I want.)

	Thank you!


More information about the Unbound-users mailing list