Hi,
When axfr request fails with a ConnectException(IOException), file
descriptors are not cleaned up properly. This can be reproduced via:
private static void testAxfr(String zone,String ns) throws
IOException, ZoneTransferException {
while (true) {
try {
ZoneTransferIn xfr =3D ZoneTransferIn.newAXFR(new Name(zone),
ns, null);
List result =3D xfr.run();
} catch (ConnectException e) {
;
}
}
}
Where zone is valid zone to transfer and ns is a server that raises
ConnectException for this zone. The code above fails quite quickly
via:
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.nio.ch.SocketDispatcher.close(SocketDispatcher.java:37)
at sun.nio.ch.SocketChannelImpl.kill(SocketChannelImpl.java:662)
at sun.nio.ch.SocketChannelImpl.implCloseSelectableChannel(SocketCh=
annelImpl.java:649)
at java.nio.channels.spi.AbstractSelectableChannel.implCloseChannel=
(AbstractSelectableChannel.java:201)
at java.nio.channels.spi.AbstractInterruptibleChannel.close(Abstrac=
tInterruptibleChannel.java:97)
at org.xbill.DNS.Client.<init>(Client.java:30)
at org.xbill.DNS.TCPClient.<init>(TCPClient.java:14)
at org.xbill.DNS.ZoneTransferIn.openConnection(ZoneTransferIn.java:=
305)
at org.xbill.DNS.ZoneTransferIn.run(ZoneTransferIn.java:554)
I fixed the problem by:
$ diff original/org/xbill/DNS/ZoneTransferIn.java
new/org/xbill/DNS/ZoneTransferIn.java
553,554c553,554
< openConnection();
< try {
---
> try {
> openConnection();
Does that make sense as a bugfix? :)
Best Regards,
--
Can Bican
|