Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error handling and hanging problems #4324

Merged
merged 9 commits into from
Mar 24, 2023
Merged

fix error handling and hanging problems #4324

merged 9 commits into from
Mar 24, 2023

Conversation

sokra
Copy link
Member

@sokra sokra commented Mar 23, 2023

Description

  • fix hanging tasks when recomputing cells
  • fix inactive tasks when using streams
  • fix fatal error handling for node.js evaluation

We need to ensure that Vc reads and connected Tasks are correctly handled in when producing streams. It's important that the Tasks are connected to something that is active when consumers read from the stream. Also Vc reads need to invalidate the stream and cause the production of a new stream. That was not handled correctly before.

Now we use a child task to produce the stream that is active as part of the function that returns the stream. We also use a little hack to update the stream in the parent task when the child task is invalidated.

It's a bit hacky, but eventually this kind of logic should probably move into turbo_tasks as part of some streaming concept.

Testing Instructions

Placing process.exit(0) in next.config.js or postcss.config.js

@vercel
Copy link

vercel bot commented Mar 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
examples-cra-web 🔄 Building (Inspect) Mar 24, 2023 at 1:26PM (UTC)
10 Ignored Deployments
Name Status Preview Comments Updated
examples-basic-web ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
examples-gatsby-web ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
examples-tailwind-web ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
examples-vite-web ⬜️ Ignored (Inspect) Mar 24, 2023 at 1:26PM (UTC)
turbo-site ⬜️ Ignored (Inspect) Visit Preview Mar 24, 2023 at 1:26PM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2023

🟢 CI likely successful 🟢

A few longer running steps are still running, but they should not be considered as blocking.

See workflow summary for details

@sokra sokra requested a review from alexkirsz March 24, 2023 13:05
@sokra sokra marked this pull request as ready for review March 24, 2023 13:05
@sokra sokra requested a review from a team as a code owner March 24, 2023 13:05
@sokra sokra changed the title improve fatal error handling fix error handling and hanging problems Mar 24, 2023
Copy link
Contributor

@alexkirsz alexkirsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what the essence of the fix is?

crates/turbo-tasks-bytes/src/stream.rs Outdated Show resolved Hide resolved
crates/turbo-tasks-bytes/src/stream.rs Show resolved Hide resolved
crates/turbopack-node/src/evaluate.rs Show resolved Hide resolved
crates/turbopack-node/src/pool.rs Outdated Show resolved Hide resolved
crates/turbopack-node/src/evaluate.rs Outdated Show resolved Hide resolved
sokra and others added 3 commits March 24, 2023 13:20
Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
@sokra sokra merged commit e4cb0b2 into main Mar 24, 2023
@sokra sokra deleted the sokra/node-fatal-error branch March 24, 2023 13:49
kodiakhq bot pushed a commit to vercel/next.js that referenced this pull request Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants