Skip to content

Commit

Permalink
actor-cache: Pass through exception type for a couple internal errors
Browse files Browse the repository at this point in the history
...to give a better idea of appropriate retry behavior.
  • Loading branch information
jclee committed May 28, 2024
1 parent a939f10 commit 269bb6a
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/workerd/io/actor-cache.c++
Original file line number Diff line number Diff line change
Expand Up @@ -2630,8 +2630,15 @@ kj::Promise<void> ActorCache::flushImpl(uint retryCount) {
} else {
LOG_NOSENTRY(ERROR, "actor cache flush failed", e);
}
return KJ_EXCEPTION(FAILED, "broken.outputGateBroken; jsg.Error: Internal error in Durable "
"Object storage write caused object to be reset.");
if (util::Autogate::isEnabled(util::AutogateKey::UPDATED_ACTOR_EXCEPTION_TYPES)) {
// Pass through exception type to convey appropriate retry behavior.
return kj::Exception(e.getType(), __FILE__, __LINE__,
kj::str("broken.outputGateBroken; jsg.Error: Internal error in Durable "
"Object storage write caused object to be reset."));
} else {
return KJ_EXCEPTION(FAILED, "broken.outputGateBroken; jsg.Error: Internal error in Durable "
"Object storage write caused object to be reset.");
}
}
});
}
Expand Down Expand Up @@ -2990,9 +2997,15 @@ kj::Promise<void> ActorCache::flushImplDeleteAll(uint retryCount) {
return kj::mv(e);
} else {
LOG_EXCEPTION("actorCacheDeleteAll", e);
return KJ_EXCEPTION(FAILED,
"broken.outputGateBroken; jsg.Error: Internal error in Durable Object storage deleteAll() caused object to be "
"reset.");
if (util::Autogate::isEnabled(util::AutogateKey::UPDATED_ACTOR_EXCEPTION_TYPES)) {
// Pass through exception type to convey appropriate retry behavior.
return kj::Exception(e.getType(), __FILE__, __LINE__,
kj::str("broken.outputGateBroken; jsg.Error: Internal error in Durable Object storage deleteAll() caused object to be reset."));
} else {
return KJ_EXCEPTION(FAILED,
"broken.outputGateBroken; jsg.Error: Internal error in Durable Object storage deleteAll() caused object to be "
"reset.");
}
}
});
}
Expand Down

0 comments on commit 269bb6a

Please sign in to comment.