[net-dns-users] AXFR (was: Re: sep() and is_sep())
calle at init.se
Tue Jun 3 06:41:50 UTC 2014
On 2 jun 2014, at 21:05, Dick Franks <rwfranks at acm.org> wrote:
> Your claim was that axfr() API had changed, which it has not.
I meant the AXFR operation, not the exact axfr() method.
> Change was clearly anticipated by somebody because the perldoc for 0.74 also contains a warning:
> This method currently returns the "IO::Socket::INET" object that will be
> used for reading, or "undef" on error. DO NOT DEPEND ON "axfr_start()"
> returning a socket object. THIS MIGHT CHANGE in future releases.
> And it just did.
That warning has been there for a very long time. Because of it I have always made sure not to use the return value from axfr_start() for anything other than true/false determination. Changing what axfr_start() returns is perfectly in accordance with long-standing documentation, and I have no issue with doing so. I do have an issue with removing the method from the documented public API.
The warning does _not_ say that axfr_next() is similarly afflicted. The warning is specifically about what axfr_start() returns. Changing what axfr_next() returns is a change in the documented public API (as is removing it, obviously).
> If memory usage is your main objection, it would be sensible to know how big a problem that poses.
Well, the memory use is what makes Net::DNS versions 0.75 and 0.76 completely unusable for one of .SE’s current applications. It could in theory still work if moved to a server with much more RAM, but I hope you can understand that the argument “We need to buy a new big server because Net::DNS changed their API” is not going to work very well.
> Upper bound memory useage estimate: 1350 . 6M6 = 8.9G bytes.
Devel::Size gives me about 3200 bytes for a Net::DNS::RR::RRSIG, so I think you estimate is low by at least half. Perl was not designed to be memory-efficient...
> Using axfr_start() and axfr_next() to get the packets and iterating over the RRs inside would seem to be the better option.
In Net::LDNS, we have a method that takes a code reference as its argument and runs that code once for every RR in the AXFR, with the RR object as its only argument. That way the method can keep as much state as it likes, and the amount of memory needed is unaffected by the number of records received. I find the interface clean and convenient to work with, but then I came up with it so I’m obviously biased in its favor.
calle at init.se -*- +46 703 - 970 612
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the net-dns-users