gelfj icon indicating copy to clipboard operation
gelfj copied to clipboard

Server hostname is cached for the duration of the process requiring restarts to refresh

Open nkvoll opened this issue 10 years ago • 3 comments

It looks like both GelfUDPSender and GelfTCPSender caches the hostnames of the graylog server for the duration of the process, which makes it unnecessary hard to fail-over / replace the server without restarting all the clients so they can resolve the hostname again.

Please correct me if I've read the source code wrong.

Is there any reason why this cannot be done upon every reconnect on the GelfTCPSender and periodically (i.e default every 10 min, configurable via a new setting) for the GelfUDPSender?

nkvoll avatar Mar 26 '14 07:03 nkvoll

You are right. Appender only resolves hostname during instantiation. Resolving hostname every send might be very time consuming.

I think configurable cache should be best option.

t0xa avatar Mar 26 '14 08:03 t0xa

Unless system property networkaddress.cache.ttl is set, it will not make a difference as the JDK will cache DNS lookups forever anyway

hackmann avatar Jun 25 '14 21:06 hackmann

Hi

@t0xa "Resolving hostname every send might be very time consuming." why? most of the time is going to be fetched from cache (depends on the ttl value) and if you don't set the networkaddress.cache.ttl in the java.security file is always going to be fetched from cache (default setting in the JVM)

Regards

danielAparicio avatar Oct 27 '16 16:10 danielAparicio