Skip to content

Commit

Permalink
ActorSqlite: Reintroduce a check for pending delete at start of handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jclee committed Sep 23, 2024
1 parent 780a156 commit cb67b25
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/workerd/io/actor-sqlite.c++
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ void ActorSqlite::maybeDeleteDeferredAlarm() {

if (haveDeferredDelete) {
metadata.setAlarm(kj::none);
haveDeferredDelete = false;
}
}

Expand Down Expand Up @@ -586,6 +587,12 @@ kj::OneOf<ActorSqlite::CancelAlarmHandler, ActorSqlite::RunAlarmHandler> ActorSq
armAlarmHandler(kj::Date scheduledTime, bool noCache) {
KJ_ASSERT(!inAlarmHandler);

if (haveDeferredDelete) {
// Unlikely to happen, unless caller is starting new alarm handler before previous alarm
// handler cleanup has completed.
LOG_WARNING_ONCE("expected previous alarm handler to be cleaned up");
}

auto localAlarmState = metadata.getAlarm();
if (localAlarmState != scheduledTime) {
if (localAlarmState == lastConfirmedAlarmDbState) {
Expand Down

0 comments on commit cb67b25

Please sign in to comment.