Skip to content

Commit

Permalink
Increase the timeout for storage operations before resetting an actor
Browse files Browse the repository at this point in the history
The lower timeout could plausibly be hit purely due to a busy CPU loop
after issuing a storage operation. The new number matches the CPU limit
per request. There's no need for this to be exactly the same number as
that, but it seemed just as good a reason as I had for any other larger
number.
  • Loading branch information
a-robinson committed Mar 11, 2024
1 parent 0afa205 commit 3fbf7c8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/workerd/io/worker.c++
Original file line number Diff line number Diff line change
Expand Up @@ -2858,14 +2858,10 @@ struct Worker::Actor::Impl {
// Implements InputGate::Hooks.

kj::Promise<void> makeTimeoutPromise() override {
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
// Give more time under ASAN.
//
// TODO(cleanup): Should this be configurable?
auto timeout = 20 * kj::SECONDS;
#else
auto timeout = 10 * kj::SECONDS;
#endif
// This really only protects against total hangs. Lowering the timeout drastically is risky,
// since low timeouts can spuriously fire when under heavy CPU load, failing requests that
// would otherwise succeed.
auto timeout = 30 * kj::SECONDS;
co_await timerChannel.afterLimitTimeout(timeout);
kj::throwFatalException(KJ_EXCEPTION(FAILED,
"broken.outputGateBroken; jsg.Error: Durable Object storage operation exceeded "
Expand Down

0 comments on commit 3fbf7c8

Please sign in to comment.