Skip to content

Commit e3d9af7

Browse files
committed
Log outputGate broken shouldRetryCountsAgainstLimits for alarms. Force exceeded memory overloaded error to be treated as user error
1 parent d21c3b8 commit e3d9af7

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/workerd/api/global-scope.c++

+12-11
Original file line numberDiff line numberDiff line change
@@ -471,16 +471,17 @@ kj::Promise<WorkerInterface::AlarmResult> ServiceWorkerGlobalScope::runAlarm(kj:
471471
!jsg::isDoNotLogException(desc) && context.isOutputGateBroken()) {
472472
LOG_NOSENTRY(ERROR, "output lock broke during alarm execution", actorId, e);
473473
} else if (context.isOutputGateBroken()) {
474-
// We don't usually log these messages, but it's useful to know the real reason we failed
475-
// to correctly investigate stuck alarms.
476-
LOG_NOSENTRY(ERROR,
477-
"output lock broke during alarm execution without an interesting error description",
478-
actorId, e);
479-
if (e.getDetail(jsg::EXCEPTION_IS_USER_ERROR) != kj::none) {
474+
if (e.getDetail(jsg::EXCEPTION_IS_USER_ERROR) != kj::none`) {
480475
// The handler failed because the user overloaded the object. It's their fault, we'll not
481476
// retry forever.
482477
shouldRetryCountsAgainstLimits = true;
483478
}
479+
480+
// We don't usually log these messages, but it's useful to know the real reason we failed
481+
// to correctly investigate stuck alarms.
482+
LOG_NOSENTRY(ERROR,
483+
"output lock broke during alarm execution without an interesting error description",
484+
actorId, e, shouldRetryCountsAgainstLimits);
484485
}
485486
return WorkerInterface::AlarmResult{.retry = true,
486487
.retryCountsAgainstLimit = shouldRetryCountsAgainstLimits,
@@ -511,16 +512,16 @@ kj::Promise<WorkerInterface::AlarmResult> ServiceWorkerGlobalScope::runAlarm(kj:
511512
LOG_NOSENTRY(ERROR, "output lock broke after executing alarm", actorId, e);
512513
}
513514
} else {
514-
// We don't usually log these messages, but it's useful to know the real reason we failed
515-
// to correctly investigate stuck alarms.
516-
LOG_NOSENTRY(ERROR,
517-
"output lock broke after executing alarm without an interesting error description",
518-
actorId, e);
519515
if (e.getDetail(jsg::EXCEPTION_IS_USER_ERROR) != kj::none) {
520516
// The handler failed because the user overloaded the object. It's their fault, we'll not
521517
// retry forever.
522518
shouldRetryCountsAgainstLimits = true;
523519
}
520+
// We don't usually log these messages, but it's useful to know the real reason we failed
521+
// to correctly investigate stuck alarms.
522+
LOG_NOSENTRY(ERROR,
523+
"output lock broke after executing alarm without an interesting error description",
524+
actorId, e, shouldRetryCountsAgainstLimits);
524525
}
525526
return WorkerInterface::AlarmResult{.retry = true,
526527
.retryCountsAgainstLimit = shouldRetryCountsAgainstLimits,

0 commit comments

Comments
 (0)