Skip to content

Commit b4f8424

Browse files
authored
Merge pull request #5790 from cloudflare/mar/undelivered-unused
Do not mark worker tracer unused for duplicate alarms.
2 parents 9cdcbf0 + 7d8cacd commit b4f8424

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/workerd/io/io-context.c++

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ kj::Date IoContext::IncomingRequest::now() {
285285

286286
IoContext::IncomingRequest::~IoContext_IncomingRequest() noexcept(false) {
287287
if (!wasDelivered) {
288+
KJ_IF_SOME(w, workerTracer) {
289+
w->markUnused();
290+
}
288291
// Request was never added to context->incomingRequests in the first place.
289292
return;
290293
}

src/workerd/io/worker-entrypoint.c++

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,12 +638,6 @@ kj::Promise<WorkerInterface::AlarmResult> WorkerEntrypoint::runAlarmImpl(
638638
// TODO(someday) If the request responsible for fulfilling this alarm were to be cancelled, then
639639
// we could probably take over and try to fulfill it ourselves. Maybe we'd want to loop on
640640
// `actor.getAlarm()`? We'd have to distinguish between rescheduling and request cancellation.
641-
642-
// Mark the tracer as unused since we're not actually running this alarm - we're just waiting
643-
// for the existing alarm's result.
644-
KJ_IF_SOME(t, incomingRequest->getWorkerTracer()) {
645-
t.markUnused();
646-
}
647641
auto result = co_await promise;
648642
co_return result;
649643
}

0 commit comments

Comments
 (0)