rework --ignoreSigInt

Send it through the main signal handler so we can see resource stats and
what was running at the time we got the SIGINT, and print an FYI note
that we're ignoring it.

Change-Id: Id3bee87d8d07c3ee74b5443198327b7b14d12ddf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201867
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
Mike Klein 2019-03-18 09:01:39 -05:00 committed by Skia Commit-Bot
parent 01f8de478c
commit ca8087f466

View File

@ -291,8 +291,13 @@ static void find_culprit() {
#endif
fflush(stdout);
signal(sig, previous_handler[sig]);
raise(sig);
if (sig == SIGINT && FLAGS_ignoreSigInt) {
info("Ignoring signal %d because of --ignoreSigInt.\n"
"This is probably a sign the bot is overloaded with work.\n", sig);
} else {
signal(sig, previous_handler[sig]);
raise(sig);
}
}
static void setup_crash_handler() {
@ -300,10 +305,6 @@ static void find_culprit() {
for (int sig : kSignals) {
previous_handler[sig] = signal(sig, crash_handler);
}
if (FLAGS_ignoreSigInt) {
signal(SIGINT, SIG_IGN);
}
}
#endif