-
Notifications
You must be signed in to change notification settings - Fork 3
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
Future does not setup waker #1
Comments
I believe causes a deadlock when multiple futures await an use std::time::Duration;
use async_once::AsyncOnce;
use lazy_static::lazy_static;
lazy_static! {
static ref FOO: AsyncOnce<u32> = AsyncOnce::new(async {
tokio::time::sleep(Duration::from_millis(10)).await;
1
});
}
#[tokio::test]
async fn test_one() {
assert_eq!(FOO.get().await, &1);
}
#[tokio::test]
async fn test_two() {
assert_eq!(FOO.get().await, &1);
}
[dependencies]
async_once = "0.2.1"
lazy_static = "1.4.0"
tokio = { version = "1.14.0", features = ["full"] } |
bddap
added a commit
to bddap/async_once
that referenced
this issue
Dec 10, 2021
bddap
added a commit
to bddap/async_once
that referenced
this issue
Dec 10, 2021
bddap
added a commit
to bddap/async_once
that referenced
this issue
Dec 10, 2021
fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am not certain if this is a legitimate problem since I haven't written any breaking tests but looking at the code it seems like it is possible to return a
Poll::Pending
without registering a waker to fire when the lock was not ready but becomes ready later.The text was updated successfully, but these errors were encountered: