Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

270 dns log#289

Merged
ricellis merged 1 commit intomasterfrom
270-dns-log
Sep 9, 2016
Merged

270 dns log#289
ricellis merged 1 commit intomasterfrom
270-dns-log

Conversation

@ricellis
Copy link
Copy Markdown
Member

@ricellis ricellis commented Sep 7, 2016

What

Added log warnings for long JVM DNS cache TTLs.

How

Added warning level log messages if the TTL is too high or can't be checked.

  • If permission is denied to read the configuration property log a warning.
  • If the property can be read and parsed, but is longer than 30 s log a warning.
  • If the value is the default setting and a SecurityManager is active then log a warning because the TTL is infinite if unconfigured with a SecurityManager.

Testing

Added tests to validate log output:
dnsNoWarningLessThan30
dnsNoWarning0
dnsWarningForever
dnsNoWarning30
dnsWarning31
dnsWarningPermissionDenied
dnsWarningDefaultWithSecurityManager

Issues

Fixes #270

@ricellis ricellis added this to the 2.6.0 milestone Sep 7, 2016
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.security.Security;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see a change that requires this to be imported.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed IDEs and import cleanup must now be turned off :(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ff73d2e

@rhyshort
Copy link
Copy Markdown
Member

rhyshort commented Sep 7, 2016

+1

@ricellis
Copy link
Copy Markdown
Member Author

ricellis commented Sep 8, 2016

@willholley are you happy with the log messages:

WARNING: DNS cache lifetime may be too long. DNS cache lifetimes in excess of 30 seconds may impede client operation during cluster failover.

and

WARNING: Permission denied to check Java DNS cache TTL. If the cache lifetime is too long cluster failover will be impeded.

?

@willholley
Copy link
Copy Markdown
Member

@ricellis the error messages look fine. Ideally we shouldn't need to prescribe a value (though 30 seconds is probably a good one) and the client should respect the DNS TTL that we return (e.g. see http://mxtoolbox.com/SuperTool.aspx?action=a%3awillholley.cloudant.com&run=toolpage). From what I can tell, this varies between DNS entries - sometimes it's 30 seconds and sometimes up to 5 minutes.

@ricellis
Copy link
Copy Markdown
Member Author

ricellis commented Sep 8, 2016

Thanks, this is logging only as we can't change the behaviour of the JVM - so 30 s is the barrier chosen for the message.

Added warning level log messages if the TTL is too high or can't be checked.
Added tests to validate log output:
dnsNoWarningLessThan30
dnsNoWarning0
dnsWarningForever
dnsNoWarning30
dnsWarning31
dnsWarningPermissionDenied
dnsWarningDefaultWithSecurityManager

Updated CHANGES.md
@ricellis ricellis merged commit 30b68c2 into master Sep 9, 2016
@ricellis ricellis deleted the 270-dns-log branch September 21, 2016 08:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants