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

fix: avoid a close deadlock in the natmanager #971

Merged
merged 1 commit into from
Jun 23, 2020
Merged

Conversation

Stebalien
Copy link
Member

Before, we would:

  1. Receive a "listen close" event from an event handler, after the teardown started.
  2. Try to add a child process to handle the event. This would block because we were in the teardown.
  3. In the teardown, try to unregister the event handler and deadlock

I've now:

  • Removed the teardown.
  • Switched to a single event loop.

Ideally, we'd remove goprocess entirely. But we'd need to refactor natmgr.

fixes #933

Before, we would:

1. Receive a "listen close" event from an event handler, after the teardown started.
2. Try to add a child process to handle the event. This would block because we
were in the teardown.
3. In the teardown, try to unregister the event handler and deadlock

I've now:

* Removed the teardown.
* Switched to a single event loop.

Ideally, we'd remove goprocess entirely. But we'd need to refactor natmgr.

fixes #933
Copy link
Contributor

@hsanjuan hsanjuan left a comment

Choose a reason for hiding this comment

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

I am too unfamiliar with this code to say this is bug-free, but the pattern looks ok.

@Stebalien Stebalien merged commit 6a3b138 into master Jun 23, 2020
@hsanjuan hsanjuan deleted the fix/close-deadlock branch June 25, 2020 16:38
@aschmahmann aschmahmann mentioned this pull request Sep 22, 2020
72 tasks
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.

Deadlock on host.Close()
2 participants