Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsdist: Handle ENOTCONN on read() over TCP #8030

merged 1 commit into from Aug 9, 2019


Copy link

@rgacogne rgacogne commented Jul 5, 2019

Short description

When a non-blocking connect() has returned EINPROGRESS, it looks like BSD can return ENOTCONN on read() even after a write() succeeded.
We did not get a trace confirming that read() can indeed return ENOTCONN in that case yet, though.

Fixes #8021.


I have:

  • read the document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
When a non-blocking connect() has returned `EINPROGRESS`, it looks
like BSD can return `ENOTCONN` on `read()` even after a `write()`
Copy link
Member Author

@rgacogne rgacogne commented Aug 9, 2019

Confirmed on FreeBSD via a PoC, see #8021 (comment). After reading the source code of NetBSD and OpenBSD I believe we can get ENOTCONN on the first sendmsg() if the handshake has not been completed yet. Based on #7685 it looks like we actually experienced that on MacOS as well.


@rgacogne rgacogne merged commit 91287ec into PowerDNS:master Aug 9, 2019
25 of 26 checks passed
@rgacogne rgacogne deleted the ddist-tcp-enotconn-read-bsd branch Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

1 participant