Skip to content

Close sockets on connection failure #50

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

Merged
merged 1 commit into from
Sep 12, 2019

Conversation

defanor
Copy link
Contributor

@defanor defanor commented Sep 11, 2019

Sockets created with connectTCP were neither closed nor returned in
case of a failure to connect, leading to file descriptor leaks.

Sockets created with connectTCP were neither closed nor returned in
case of a failure to connect, leading to file descriptor leaks.
@hvr hvr merged commit a936764 into haskell-hvr:master Sep 12, 2019
@hvr
Copy link
Collaborator

hvr commented Sep 12, 2019

Good catch! Thanks!

But to be fair, the GC is supposed to kick in at some point and close the dangling sockets when they become garbage. But eagerly closing the sockets on failure is definitely desirable!

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.

2 participants