Skip to content

Commit

Permalink
Log debug information when queue events time out due to lingering wai…
Browse files Browse the repository at this point in the history
…tUntil tasks
  • Loading branch information
jbwcloudflare committed Feb 21, 2024
1 parent 434c5f7 commit c241069
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/workerd/api/queue.c++
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,12 @@ kj::Promise<WorkerInterface::CustomEvent::Result> QueueCustomEventImpl::run(
// reuse the scheduled worker logic and timeout for now.
auto completed = co_await incomingRequest->finishScheduled();

// Log some debug info if the queue handler completed but other waituntils did not
if (!completed && queueEventHolder->event->getIsQueueHandlerComplete()) {
auto taskTrace = incomingRequest->getContext().getWaitUntilTasks().trace();
KJ_LOG(WARNING, kj::str("Queue event timed out with lingering waitUntil tasks:\n", taskTrace));
}

co_return WorkerInterface::CustomEvent::Result {
.outcome = completed ? context.waitUntilStatus() : EventOutcome::EXCEEDED_CPU,
};
Expand Down

0 comments on commit c241069

Please sign in to comment.