Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Signal handling, part 2 #19

@itizir

Description

@itizir

It's interesting to see how the 'monitor' approach was suggested as an alternative way of handling signals. Still, regardless, there seem to be other ways to make things cleaner with few little steps.

The default behaviour regarding signal handling is a bit confusing: if ForwardSignals is not set, all signals get captured (thus ignored) by the parent and forwarded to the child. Not sure this is the intended behaviour, at least it wouldn't be very clear from the description.
I would suggest that if ForwardSignals is nil, Notify shouldn't be called for the forwarding channel. Or the documentation should be clearer (and one would have to, for instance, make a list with just KILLSIG to effectively not forward any signals).

On top of that, there is a small issue when signals are both meant to be sent on the 'ignore' and 'forward' channels (it is arguably unnecessary/inconsistent to specify the same signals in both lists, but since the current default behaviour is to forward all messages...):
because the channels are not buffered, such a signal will end up in only one of them. This at the very least should be fixed...

I'm opening a PR, starting with this latter change. Let me know what makes most sense! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions