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(core): Don't wake up operator futures while not ready #2415

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/src/types/operator/operator_futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ where
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
*self = match mem::replace(self.as_mut().get_mut(), OperatorFuture::Empty) {
OperatorFuture::Idle(inner, path, args, f) => {
// Wake up to make sure the future is ready after the
// future has been built.
cx.waker().wake_by_ref();
OperatorFuture::Poll(f(inner, path, args))
}
OperatorFuture::Poll(mut fut) => match fut.as_mut().poll(cx) {
Expand All @@ -107,7 +110,6 @@ where
panic!("future polled after completion");
}
};
cx.waker().wake_by_ref();
Poll::Pending
}
}
Expand Down