mirror of
https://github.com/valitydev/woody_erlang.git
synced 2024-11-06 02:15:19 +00:00
Anticipate nxdomain
s even after resolving (#18)
Turns out resolving server endpoint and sending request to this endoint are racy with respect to domain name resolution: for some reason `gen_tcp` resolves literal IP addresses through general DNS mechanism. This means that in the event DNS goes down between resolving step and sending step one could get `{error, nxdomain}` in the second step.
This commit is contained in:
parent
3ddacb9296
commit
90d386c252
@ -244,6 +244,7 @@ handle_result({error, Reason}, WoodyState) when
|
||||
Reason =:= enetunreach;
|
||||
Reason =:= ehostunreach;
|
||||
Reason =:= eacces;
|
||||
Reason =:= nxdomain;
|
||||
element(1, Reason) =:= resolve_failed
|
||||
->
|
||||
BinReason = woody_error:format_details(Reason),
|
||||
|
@ -275,6 +275,7 @@ handle_response({error, Reason}, WoodyState) when
|
||||
Reason =:= enetunreach;
|
||||
Reason =:= ehostunreach;
|
||||
Reason =:= eacces;
|
||||
Reason =:= nxdomain;
|
||||
element(1, Reason) =:= resolve_failed
|
||||
->
|
||||
BinReason = woody_error:format_details(Reason),
|
||||
|
Loading…
Reference in New Issue
Block a user