Skip to content

Deregister signal channel#16

Merged
peterbourgon merged 1 commit intooklog:masterfrom
alindeman:signal-stop
May 8, 2020
Merged

Deregister signal channel#16
peterbourgon merged 1 commit intooklog:masterfrom
alindeman:signal-stop

Conversation

@alindeman
Copy link
Copy Markdown
Contributor

@alindeman alindeman commented Apr 7, 2020

If SignalHandler is being used as a mechanism to exit the program entirely, these resources will be cleaned up naturally. But if not, the signal should be explicitly deregistered.

Make sure the channel is eligible to be garbage collected and that no additional signals should be delivered to the channel after this actor exits.

See also: https://go-review.googlesource.com/c/go/+/219640/2/src/context/context.go#543

If `SignalHandler` is being used as a mechanism to exit the program
entirely, these resources will be cleaned up naturally. But if not,
the signal should be explicitly deregistered.

Make sure the channel is eligible to be garbage collected and that no
additional signals should be delivered to the channel after this actor
exits.
@peterbourgon
Copy link
Copy Markdown
Member

Great catch, thank you!

@peterbourgon peterbourgon merged commit c709688 into oklog:master May 8, 2020
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