UDP Emitter should refresh daemon address periodically and should not throw communication errors
- Dominant language
- Java
- Stars
- 100
- Forks
- 100
- PR merge metrics
- No merged PRs in 30d
Description
We have the XRay daemon running in an ECS container with awsvpc network mode and Route53 Auto Naming Service Discovery enabled. The XRay address is set via the AWS_XRAY_DAEMON_ADDRESS system property as fqdn. Due to some shortcomings in the UDPEmitter, this causes some problems.
1. Sometimes the XRay container is not started at the moment the UDPEmitter on the 'to be traced' server is constructed. The java InetAddress could not resolve the hostname and sets a flag 'unknown host'. This flag will never be reset.
2. The IP address of the XRay container could change when it is restarted. The UDPEmitter keeps throwing its data to the first found IP.
3. The communication errors which occurs as result of cause 1, is not catched.
I think it will be easy to implement a polling thread which periodically re-resolves the daemon address and pass the new InetAddress to the UDPEmitter.
And add some try/catch wrappers around the UDPEmitter data transfer methods.
Contributor guide
Assessment
This issue has not been assessed yet.