Skip to content

Commit

Permalink
Merge pull request #3294 from cloudflare/dlapid/fix_trace_lifetime
Browse files Browse the repository at this point in the history
Fix lifetimes in sendTracesToExportedHandler
  • Loading branch information
danlapid authored Jan 6, 2025
2 parents 094c9e4 + a88f555 commit d8de55a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/workerd/api/trace.c++
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,12 @@ kj::Promise<void> sendTracesToExportedHandler(kj::Own<IoContext::IncomingRequest
auto entrypointName = entrypointNamePtr.map([](auto s) { return kj::str(s); });
try {
co_await context.run(
[&context, nonEmptyTraces = kj::mv(nonEmptyTraces), entrypointName = kj::mv(entrypointName),
[&context, nonEmptyTraces = nonEmptyTraces.asPtr(), entrypointName = kj::mv(entrypointName),
props = kj::mv(props)](Worker::Lock& lock) mutable {
jsg::AsyncContextFrame::StorageScope traceScope = context.makeAsyncTraceScope(lock);

auto handler = lock.getExportedHandler(entrypointName, kj::mv(props), context.getActor());
return lock.getGlobalScope().sendTraces(nonEmptyTraces.asPtr(), lock, handler);
return lock.getGlobalScope().sendTraces(nonEmptyTraces, lock, handler);
});
} catch (kj::Exception e) {
// TODO(someday): We only report sendTraces() as failed for metrics/logging if the initial
Expand Down

0 comments on commit d8de55a

Please sign in to comment.