-
Notifications
You must be signed in to change notification settings - Fork 30k
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
src: only block SIGUSR1 when HAVE_INSPECTOR #12266
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more for nodejs/build#419.
src/node.cc
Outdated
sigset_t sigmask; | ||
sigemptyset(&sigmask); | ||
sigaddset(&sigmask, SIGUSR1); | ||
const int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr); | ||
CHECK_EQ(err, 0); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write this as #endif // HAVE_INSPECTOR
? (Note the two blanks before the comment.)
You can't really do the CHECK_EQ at this point because fds 0-2 might not be pointing to valid file descriptions yet.
Yep, I'll fix that.
Sorry I'm missing something here :( |
Check the |
Oh! Let's not speak of this again :) |
src/node.cc
Outdated
CHECK_EQ(err, 0); | ||
#endif // HAVE_INSPECTOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to make this a torment for you but the reason SIGUSR1 is blocked first thing is to make the 'kill window' as small as possible. Some tools start node and immediately send a SIGUSR1 - if the signal isn't masked, it kills the process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, that makes sense. I was trying to avoid the additional HAVE_INSTRUCTOR guard but that is no problem.
I don't want to make this a torment
No torment at all, I appreciate all the reviews and feedback!
I'm currently seeing a timeout error for test-signal-handler.js on macosx when using the following configuration: ./configure --debug --without-ssl && make -j8 test --without-ssl implies that there will be no inspector but the signal SIGUSR1 is blocked in PlatformInit just the same. But in this case never unblocked which is causing the signal to never be delivered to the handlers in test-signal-handler.js and it loops until it times out. Not sure if this is the best way of fixing this but hopefully more eyes on this will help.
a2b5d5e
to
d9d1164
Compare
I'm currently seeing a timeout error for test-signal-handler.js on macosx when using the following configuration: ./configure --debug --without-ssl && make -j8 test --without-ssl implies that there will be no inspector but the signal SIGUSR1 is blocked in PlatformInit just the same. But in this case never unblocked which is causing the signal to never be delivered to the handlers in test-signal-handler.js and it loops until it times out. Not sure if this is the best way of fixing this but hopefully more eyes on this will help. PR-URL: nodejs#12266 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Landed in 65a6e05 |
cc @danbev |
I'm currently seeing a timeout error for test-signal-handler.js on macosx when using the following configuration: ./configure --debug --without-ssl && make -j8 test --without-ssl implies that there will be no inspector but the signal SIGUSR1 is blocked in PlatformInit just the same. But in this case never unblocked which is causing the signal to never be delivered to the handlers in test-signal-handler.js and it loops until it times out. Not sure if this is the best way of fixing this but hopefully more eyes on this will help. PR-URL: nodejs#12266 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
@italoacasas I've added #12332 for this and two other commits needed to land this on the v7.x-staging branch. |
I'm currently seeing a timeout error for test-signal-handler.js on
macosx when using the following configuration:
./configure --debug --without-ssl && make -j8 test
--without-ssl implies that there will be no inspector but the signal
SIGUSR1 is blocked in PlatformInit just the same. But in this case
never unblocked which is causing the signal to never be delivered to
the handlers in test-signal-handler.js and it loops until it times out.
Not sure if this is the best way of fixing this but hopefully more eyes
on this will help.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
src