Skip to content

Fix finalizer getting triggered in ghc 8.2.2 - #288

Merged
eborden merged 2 commits into
2.7from
hold-reference-to-original-socket-in-accept
Dec 30, 2017
Merged

eborden merged 2 commits into
2.7from
hold-reference-to-original-socket-in-accept

Conversation

@eborden

@eborden eborden commented Dec 29, 2017

Copy link
Copy Markdown
Collaborator

GHC 8.2.2 more aggresively reclaims Weak. This causes the socket to be
closed in accept before c_accept is called. Utilizing withMVar
allows the reference to be held until c_accept has been called.

This fixes: #287

GHC 8.2.2 more aggresively reclaims `Weak`. This causes the socket to be
closed in `accept` before `c_accept` is called. Utilizing `withMVar`
allows the reference to be held until `c_accept` has been called.
@eborden eborden self-assigned this Dec 29, 2017

@kazu-yamamoto kazu-yamamoto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Please merge this into 2.7 by yourself.
If you want to merge this to master, please go ahead. But please note that the code changed a lot.

@eborden
eborden merged commit 849d7eb into 2.7 Dec 30, 2017
@eborden
eborden deleted the hold-reference-to-original-socket-in-accept branch December 30, 2017 23:24
eborden added a commit that referenced this pull request Dec 30, 2017
GHC 8.2.2 more aggressively reclaims `Weak`. This causes the socket to be
closed in `accept` before `c_accept` is called. Utilizing `withMVar`
allows the reference to be held until `c_accept` has been called.
@eborden

eborden commented Dec 30, 2017

Copy link
Copy Markdown
Collaborator Author

I also merged this in to master here: b7b35fb

kazu-yamamoto pushed a commit to kazu-yamamoto/network that referenced this pull request Jan 29, 2018
* Fix finalizer getting triggered in ghc 8.2.2

GHC 8.2.2 more aggresively reclaims `Weak`. This causes the socket to be
closed in `accept` before `c_accept` is called. Utilizing `withMVar`
allows the reference to be held until `c_accept` has been called.

* Update variable for readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants