-
Notifications
You must be signed in to change notification settings - Fork 89
DNS lookup is done on every reconnect attempt #67
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
Conversation
…dress for the lifetime of the application is problematic in a dynamic enviroment like docker containers. If the machine address changes, applications need to be restarted to pick up the correct address and log correctly.
|
|
||
| private String name; | ||
|
|
||
| private String host; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use final keyword
|
|
||
| private String host; | ||
|
|
||
| private int port; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use final keyword
| pendings = ByteBuffer.allocate(bufferCapacity); | ||
| this.host = host; | ||
| this.port = port; | ||
| server = new InetSocketAddress(host, port); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed
|
|
||
| private String name; | ||
|
|
||
| private String host; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server can be removed since the instance variable in the following line can be replaced with socket.getInetAddress().
LOG.error("Cannot send logs to " + server);
|
@j3grewal Thanks! I left some comments. Could you address them? BTW, as you may know, |
|
Thanks @komamitsu I have made the changes as per your comments. Yes, we had tried setting the networkaddress.cache.ttl but it didn't solve the problem because of the caching in this particular class. |
|
Thanks for merging @komamitsu What are your plans for the next release? |
|
@j3grewal I'll release a new version later this week. BTW, I noticed https://github.com/komamitsu/fluency (Yet another fluent logger Java) already supports this feature. Also, it has some other features. I'd be happy if you try it when you get a chance :) |
DNS lookup is done on every reconnect attempt. Caching the machine address for the lifetime of the application is problematic in a dynamic environment like docker containers. If the machine address changes, applications need to be restarted to pick up the correct address and log correctly.