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

Make setNonBlockIfNeeded public and document its use. #242

Merged
merged 1 commit into from
Mar 29, 2017

Conversation

roberth
Copy link
Contributor

@roberth roberth commented Mar 28, 2017

Making a socket out of a file descriptor may cause the RTS to hang when the fd blocks, so we need to use setNonBlockIfNeeded when using file descriptors that were not created by the network library (which is an otherwise supported use case)
This PR contains the export and the extra documentation.

Note that it is possible to make network more robust against this situation by adding the call to mkSocket, but that will introduce unnecessary system calls in almost all situations. Haskell has been doing pretty well without that extra safety. (famous last words)

@roberth
Copy link
Contributor Author

roberth commented Mar 29, 2017

@kazu-yamamoto , could you review this PR? It documents an issue that can hang the RTS.

@kazu-yamamoto
Copy link
Collaborator

LGTM.

@eborden Would you merge this PR. I'm now on vacation.

@roberth
Copy link
Contributor Author

roberth commented Mar 29, 2017

Thanks Kazu, sorry for interrupting. Enjoy your vacation!

@eborden
Copy link
Collaborator

eborden commented Mar 29, 2017

LGTM. Thanks for your contribution!

@eborden eborden merged commit 6e9c324 into haskell:master Mar 29, 2017
@eborden eborden mentioned this pull request May 16, 2017
eborden added a commit that referenced this pull request May 17, 2017
 * Zero memory of `sockaddr_un` if abstract socket
   [#220](#220)

 * Improving error messages
   [#232](#232)

 * Allow non-blocking file descriptors via `setNonBlockIfNeeded`
   [#242](#242)

 * Update config.{guess,sub} to latest version
   [#244](#244)

 * Rename `my_inet_ntoa` to avoid symbol conflicts
   [#228](#228)

 * Test infrastructure improvements
   [#219](#219)
   [#217](#217)
   [#218](#218)

 * House keeping and cleanup
   [#238](#238)
   [#237](#237)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants