Skip to content

Commit

Permalink
Stop sending bug reports on OOMs.
Browse files Browse the repository at this point in the history
This is to provide a cleaner path to halting.

PiperOrigin-RevId: 492310125
Change-Id: Ie8c84860b687aaf3d6c3f8ffb78e39fbf49b5297
  • Loading branch information
justinhorvitz authored and copybara-github committed Dec 1, 2022
1 parent 062b83f commit 0dcfe21
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ public static void handleCrash(Crash crash, CrashContext ctx) {
String crashMsg;
String heapDumpPath;
// Might be a wrapped OOM - the detailed exit code reflects the root cause.
if (crash.getDetailedExitCode().getExitCode().equals(ExitCode.OOM_ERROR)) {
boolean isOom = crash.getDetailedExitCode().getExitCode().equals(ExitCode.OOM_ERROR);
if (isOom) {
crashMsg = constructOomExitMessage(ctx.getExtraOomInfo());
heapDumpPath = ctx.getHeapDumpPath();
if (heapDumpPath != null) {
Expand All @@ -275,8 +276,10 @@ public static void handleCrash(Crash crash, CrashContext ctx) {
// we are crashing, who knows if it will complete. It's more important that we write
// exit code and failure detail information so that the crash can be handled correctly.
emitExitData(crash, ctx, numericExitCode, heapDumpPath);
// Don't try to send a bug report during a crash in a test, it will throw itself.
if (ctx.shouldSendBugReport() && !TestType.isInTest()) {
// Skip sending a bug report if the crash is an OOM - attempting an RPC while out of
// memory can cause issues. Also, don't try to send a bug report during a crash in a test,
// it will throw itself.
if (ctx.shouldSendBugReport() && !isOom && !TestType.isInTest()) {
sendBugReport(throwable, ctx.getArgs());
}
} finally {
Expand Down

0 comments on commit 0dcfe21

Please sign in to comment.