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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential sleeping barber in async prefetching #20791

Open
wants to merge 14 commits into
base: devel
Choose a base branch
from

Conversation

mpoeter
Copy link
Member

@mpoeter mpoeter commented Mar 27, 2024

Scope & Purpose

Previously we disabled async prefetching for any node that had a (indirect) dependency on a RemoteNode, because of the following problem: If an async prefetch task returns WAITING (e.g. from a RemoteNode), the wakeup could arrive at a point were the RestHandler has already been removed and is thus swallowed. When the next RestHandler makes the next call, we simply return the result from the prefetch task. But if that is WAITING, we now wait for a wakeup that will never come.

To fix that, the next call will now check if the prefetch task has returned WAITING, and in that case will immediately make the next call to the upstream dependency. If the wakeup has already occurred, we will get the new data, otherwise we will get another WAITING, but then we know that the wakeup is still going to happen.

  • 馃崟 New feature

Checklist

  • Tests - this is covered by existing tests
  • 馃摉 CHANGELOG entry made

Related Information

If an async prefetch task returns WAITING (e.g. from a RemoteNode), the wakeup could arrive at a point were the RestHandler has already been removed and is thus swallowed. When the next RestHandler makes the next call, we simply return the result from the prefetch task. But if that is WAITING, we now wait for a wakeup that will never come.
To fix that, the next call will check if the prefetch task has returned WAITING, and in that case will immediately make the next call to the upstream dependency. If the wakeup has already occurred, we will get the new data, otherwise we will get another WAITING, but then we know that the wakeup is still going to happen.
@mpoeter mpoeter added this to the devel milestone Mar 27, 2024
@mpoeter mpoeter requested a review from a team as a code owner March 27, 2024 13:59
@cla-bot cla-bot bot added the cla-signed label Mar 27, 2024
Copy link
Contributor

@jsteemann jsteemann left a comment

Choose a reason for hiding this comment

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

LGTM

@mpoeter mpoeter force-pushed the feature/lift-remote-async-prefetch-restriction branch from d652f27 to 2ecaf27 Compare April 11, 2024 15:31
@mpoeter mpoeter requested a review from a team as a code owner April 12, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants