nflow-generator icon indicating copy to clipboard operation
nflow-generator copied to clipboard

[enhancement] retry on DNS or connection failures

Open jguay opened this issue 6 years ago • 0 comments

Current behaviour When I connect to a container which may be down or not yet started, I hit error like this one

nflow0                     | time="2019-03-15T10:32:45Z" level=fatal msg="Error connecting to the target collector: write udp 172.18.0.5:40304->172.18.0.6:2055: write: connection refused"

Cause It seems a connection error is considered fatal here

Same point about DNS problem a few lines above which is also considered fatal

Requested feature It would be great if any connection error was just displayed and the connection would just be retried after 10 seconds so the nflow-generator container just keeps trying instead of failing

Workaround If I just set a restart policy for the container, or some script which would delay entrypoint till the destination host/port is reachable, I will be able to get around it but would prefer if the code just retry, never coded in go but could probably make a PR for this as change may be trivial

jguay avatar Mar 15 '19 10:03 jguay