Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lookup.run can exit and the state can be not done causing an exception in checkDone #137

Closed
jschewebbn opened this issue Oct 20, 2020 · 4 comments

Comments

@jschewebbn
Copy link

@jschewebbn jschewebbn commented Oct 20, 2020

The method Lookup.run can exit with done still set to false and this causes errors in methods that call it. In my case I have this stack trace using dnsjava 3.2.2. Here the call to Lookup.run in Address.getByName returned null. However since there isn't an else statement in the if/else inside if(!done) of Lookup.run it's possible for the method to exit with done set to false and then Lookup.checkDone throws an exception even though Lookup.run has completed.

        at org.xbill.DNS.Lookup.checkDone(Lookup.java:621)
        at org.xbill.DNS.Lookup.getResult(Lookup.java:659)
        at org.xbill.DNS.Address.lookupHostName(Address.java:264)
        at org.xbill.DNS.Address.getByName(Address.java:309)
@jschewebbn
Copy link
Author

@jschewebbn jschewebbn commented Oct 20, 2020

I believe this shows up when the list of search domains is an array of size zero.

@jschewebbn
Copy link
Author

@jschewebbn jschewebbn commented Oct 20, 2020

A related item, you may want to make it clear which calls to setDefaultSearchDomains accept null and possibly have one separate method to set the value to null explicitly, something like clearDefaultSearchDomains.

@ibauersachs
Copy link
Member

@ibauersachs ibauersachs commented Oct 21, 2020

3.3.0 contains a fix (#118) relating to search domains and Lookup.run. Have you tried that?

@jschewebbn
Copy link
Author

@jschewebbn jschewebbn commented Oct 21, 2020

It looks like using version 3.3.0 fixes the problem when the search domains is an array of size zero.

@jschewebbn jschewebbn closed this Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.