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

Improve your SIG{__DIE__} handler? #17

Open
Timbus opened this issue Dec 21, 2016 · 0 comments
Open

Improve your SIG{__DIE__} handler? #17

Timbus opened this issue Dec 21, 2016 · 0 comments

Comments

@Timbus
Copy link

Timbus commented Dec 21, 2016

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__}.

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

No branches or pull requests

1 participant