Skip to content

Improve your SIG{__DIE__} handler? #17

@Timbus

Description

@Timbus

Hi,
I found myself here because a coworker found bug #73 in your nagios plugins repo, and nearly tried to fork NetAddr::IP::InetBase thinking it was a fault in that module. Luckily I did some quick digging to see that it was a $SIG{__DIE__} handler in our code breaking everything. It was undoubtedly the same issue affecting check_kafka.pl

I'm wondering if you haven't tried using $EXCEPTIONS_BEING_CAUGHT or $^S inside your die handler to prevent it from exiting if you don't need it to.

Better yet -- you can always stop exiting from your $SIG{__DIE__} handler which would allow exceptions to bubble up naturally. You might even be able to avoid using the signal handler entirely.. Read the bottom couple paragraphs of the signal var for more information on avoiding $SIG{__DIE__}.

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