这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@sokra
Copy link
Member

@sokra sokra commented Jan 22, 2024

Description

This fixes a bug where inactive tasks get stuck in "in progress" which causes the updateInfo stream to be incorrect (not ending).

It can happen when

  • a task reads something strongly consistent
  • the task (subgraph) is not active (e.g. was removed due to changes)

In this case the strongly consistent read will never finish as it waits for the subgraph to finish, but dirty tasks in that subgraph won't be scheduled as the subgraph is not active.

This PR fixes that by making a subgraph that is currently strongly consistently read temporarily active (while being read).

That's similar to normal read scheduling dirty tasks.

We never want in progress tasks to be blocked by anything. Any blocker should be resolved by executing tasks.

Potential alternative: We could also change dirty tasks to not count as pending. That would also allow any strongly consistent read to complete, but it won't be consistent with changes that caused these tasks to be dirty.

Closes PACK-2268

@vercel
Copy link
Contributor

vercel bot commented Jan 22, 2024

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

Name Status Preview Comments Updated (UTC)
rust-docs ❌ Failed (Inspect) Jan 22, 2024 3:00pm
turbo-site ✅ Ready (Inspect) Visit Preview Jan 22, 2024 3:00pm
9 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2024 3:00pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2024 3:00pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2024 3:00pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2024 3:00pm
examples-native-web ⬜️ Ignored (Inspect) Jan 22, 2024 3:00pm
examples-nonmonorepo ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2024 3:00pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2024 3:00pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2024 3:00pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Jan 22, 2024 3:00pm

@sokra sokra changed the title Sokra/fix hanging fix a hanging issue with strongly consistent reads Jan 22, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

@github-actions
Copy link
Contributor

✅ This change can build next-swc

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2024

🟢 CI successful 🟢

Thanks

@sokra sokra merged commit 67e79e4 into main Jan 22, 2024
@sokra sokra deleted the sokra/fix-hanging branch January 22, 2024 16:30
timneutkens added a commit to vercel/next.js that referenced this pull request Jan 23, 2024
* vercel/turborepo#7067 <!-- Tobias Koppers - fix a
hanging issue with strongly consistent reads -->
* vercel/turborepo#7068 <!-- Tobias Koppers - add
lazy_remove_children feature flag -->
* vercel/turborepo#7073 <!-- OJ Kwon -
fix(ecmascript): collect recoverable error after parse -->

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…7067)

### Description

This fixes a bug where inactive tasks get stuck in "in progress" which
causes the updateInfo stream to be incorrect (not ending).

It can happen when
* a task reads something strongly consistent
* the task (subgraph) is not active (e.g. was removed due to changes)

In this case the strongly consistent read will never finish as it waits
for the subgraph to finish, but dirty tasks in that subgraph won't be
scheduled as the subgraph is not active.

This PR fixes that by making a subgraph that is currently strongly
consistently read temporarily active (while being read).

That's similar to normal read scheduling dirty tasks.

We never want in progress tasks to be blocked by anything. Any blocker
should be resolved by executing tasks.

Potential alternative: We could also change dirty tasks to not count as
pending. That would also allow any strongly consistent read to complete,
but it won't be consistent with changes that caused these tasks to be
dirty.


Closes PACK-2268
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…7067)

### Description

This fixes a bug where inactive tasks get stuck in "in progress" which
causes the updateInfo stream to be incorrect (not ending).

It can happen when
* a task reads something strongly consistent
* the task (subgraph) is not active (e.g. was removed due to changes)

In this case the strongly consistent read will never finish as it waits
for the subgraph to finish, but dirty tasks in that subgraph won't be
scheduled as the subgraph is not active.

This PR fixes that by making a subgraph that is currently strongly
consistently read temporarily active (while being read).

That's similar to normal read scheduling dirty tasks.

We never want in progress tasks to be blocked by anything. Any blocker
should be resolved by executing tasks.

Potential alternative: We could also change dirty tasks to not count as
pending. That would also allow any strongly consistent read to complete,
but it won't be consistent with changes that caused these tasks to be
dirty.


Closes PACK-2268
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…7067)

### Description

This fixes a bug where inactive tasks get stuck in "in progress" which
causes the updateInfo stream to be incorrect (not ending).

It can happen when
* a task reads something strongly consistent
* the task (subgraph) is not active (e.g. was removed due to changes)

In this case the strongly consistent read will never finish as it waits
for the subgraph to finish, but dirty tasks in that subgraph won't be
scheduled as the subgraph is not active.

This PR fixes that by making a subgraph that is currently strongly
consistently read temporarily active (while being read).

That's similar to normal read scheduling dirty tasks.

We never want in progress tasks to be blocked by anything. Any blocker
should be resolved by executing tasks.

Potential alternative: We could also change dirty tasks to not count as
pending. That would also allow any strongly consistent read to complete,
but it won't be consistent with changes that caused these tasks to be
dirty.


Closes PACK-2268
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…7067)

### Description

This fixes a bug where inactive tasks get stuck in "in progress" which
causes the updateInfo stream to be incorrect (not ending).

It can happen when
* a task reads something strongly consistent
* the task (subgraph) is not active (e.g. was removed due to changes)

In this case the strongly consistent read will never finish as it waits
for the subgraph to finish, but dirty tasks in that subgraph won't be
scheduled as the subgraph is not active.

This PR fixes that by making a subgraph that is currently strongly
consistently read temporarily active (while being read).

That's similar to normal read scheduling dirty tasks.

We never want in progress tasks to be blocked by anything. Any blocker
should be resolved by executing tasks.

Potential alternative: We could also change dirty tasks to not count as
pending. That would also allow any strongly consistent read to complete,
but it won't be consistent with changes that caused these tasks to be
dirty.


Closes PACK-2268
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.

3 participants