next.js
81b96dd4 - feat(turbo-tasks): Generate a trace of transient tasks when panicking (#77600)

Commit
261 days ago
feat(turbo-tasks): Generate a trace of transient tasks when panicking (#77600) When panicking due to a transient task called from a persistent task, it's often hard to figure out why the read task was transient in the first place, as turbo-tasks doesn't have normal stack traces. To make it worse, these issues are often hard to reproduce (can happen due to file invalidations, turbopack restarts, etc), so we want to gather as much information from users reporting bugs as possible in the panic message. This uses `TraceRawVcs` to log debug information about transient dependencies: ``` Adder::add_method (read cell of type turbo-tasks@TODO::::primitives::u64) self: Adder::new (read cell of type turbo-tasks-backend@TODO::::Adder) args: unknown transient task (read cell of type turbo-tasks@TODO::::primitives::unit) args: unknown transient task (read cell of type turbo-tasks@TODO::::primitives::u16) unknown transient task (read cell of type turbo-tasks@TODO::::primitives::u32) ``` In this example, `unknown transient task` refers to a `TurboTasks::run_once` call, which has no name. For a real-world example of this in use, see #77798. This uses information already stored on cached tasks, so there's no additional tracking overhead, outside of the work that must happen on a panic (a cold codepath).
Author
bgw bgw
Parents
Loading