diff options
| author | Jon Gjengset <jon@thesquareplanet.com> | 2025-10-04 20:10:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-04 17:10:07 -0700 |
| commit | 37fe4eff0e23ffbc251034b8001a1065c55f9951 (patch) | |
| tree | c8cc7dd8098e71f5955be591868c6d4f910a23e6 /src/core/taskq.h | |
| parent | ef8e535c441f116f653e327cc66c21286a4104ec (diff) | |
| download | nng-37fe4eff0e23ffbc251034b8001a1065c55f9951.tar.gz nng-37fe4eff0e23ffbc251034b8001a1065c55f9951.tar.bz2 nng-37fe4eff0e23ffbc251034b8001a1065c55f9951.zip | |
remaps EAI_AGAIN to NNG_EADDRINVAL (#2169)
When running nng tests in CI under nix on Linux, I would see
`nng_dialer_start` fail with `NNG_EAGAIN` when invoked with `flags = 0`
and a URL of `tcp://999.888.777.666:8080` (this is in a test that is
supposed to check that dialing that gives you `NNG_EINVAL` or
`NNG_EADDRINVAL`).
This can happen if `nni_resolv_ip` in `posix_resolv_gai.c` gets
`EAI_AGAIN` from `getaddrinfo`, which the man pages suggest _can_ happen
due to "a temporary failure in name resolution". In the nix case, this
is due to the nix build sandbox, but it can also arise simply due to DNS
overload or misconfiguration.
In either case, nng should not bubble up `EAI_AGAIN` `as `NNG_EAGAIN`
from `nng_dialer_start`, as `NNG_EAGAIN` has a different semantic
meaning. `NNG_EAGAIN` is more equivalent to "would block", and should
only be generated through calls with the `NONBLOCK` flag. We don't have
a perfect mapping for `EAI_AGAIN`, but the closest is probably
`NNG_ADDRINVAL` to indicate that we failed to resolve the given address
(even if it's temporary). Another option would be to introduce another
error variant like `NNG_ENAMELOOKUP`, but that felt excessive to cover
this case.
Diffstat (limited to 'src/core/taskq.h')
0 files changed, 0 insertions, 0 deletions
