Skip to content

Commit

Permalink
Assert rather than return when IoContext is aborted (#2938)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell authored Oct 16, 2024
1 parent 8cca20f commit 507e965
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/workerd/io/io-context.c++
Original file line number Diff line number Diff line change
Expand Up @@ -1092,11 +1092,13 @@ void IoContext::runImpl(Runnable& runnable,
// If we were terminated because abort() was called, then it's not an unknown
// reason...
if (!abortFulfiller->isWaiting()) {
// Nothing to do here. Do not log anything. The assumption is that we've
// terminated because the IoContext was aborted and isolate->TerminateExection()
// was called (likely because of someone using process.exit(...) in Node.js
// compat mode).
return;
// The assumption is that we've terminated because the IoContext was aborted and
// isolate->TerminateExection() was called (likely because of someone using
// process.exit(...) in Node.js compat mode).

// TODO(later): If this ends up being too spammy in sentry that we'll need to
// revisit, but for now... log the assert and move on.
KJ_FAIL_ASSERT("request terminated because it was aborted");
}

// That should have thrown, so we shouldn't get here.
Expand Down

0 comments on commit 507e965

Please sign in to comment.