Open patricoferris opened 2 years ago
Aye, it returns empty as you expected.
The thing is Unix.getaddrinfo
completely ignores errno, it simply checks if it got 0 and then tries to build a list, returning empty if nothing is there.
We should probably do the same, catch all Luv_errors and return an empty list.
Should we close this, now that Eio doesn't have the luv backend anymore?
It also affects eio_posix (I've updated the title).
I'm hitting an issue via cohttp-eio with a statically compiled binary using musl, where getaddrinfo fails to resolve dns names. I hit this branch https://github.com/mirage/ocaml-cohttp/blob/3cd08e5a34d38a322055390b86f4b5dd6bdc01e7/cohttp-eio/src/client.ml#L82 with the error "failed to resolve hostname". It seems not relying on the glibc getaddrinfo would be nice for this reason as well.
It seems that luv raises an exception instead of returning an empty list.
This returns:
I can't currently run this properly on Linux with Uring but I'm assuming it returns
[]
becauseUnix.getaddrinfo
does.