You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Similar to try_ready!, but also track/untrack accept task
// in TcpListener resource.
// In this way, when the listener is closed, the task can be
// notified to error out (instead of stuck forever).
AcceptState::Pending(refmut r) => match r.poll_accept(){
Ok(futures::prelude::Async::Ready(t)) => {
r.untrack_task();
t
}
Ok(futures::prelude::Async::NotReady) => {
// Would error out if another accept task is being tracked.
r.track_task()?;
returnOk(futures::prelude::Async::NotReady);
}
Err(e) => {
r.untrack_task();
returnErr(e);
}
},
AcceptState::Empty => panic!("poll Accept after it's done"),
};
some connections immediately yields Ok(futures::prelude::Async::Ready(t)) without ever yields Ok(futures::prelude::Async::NotReady). Thus no task is waiting => assertion would fail.
It is possible that an accept attempt would yield WouldBlock on first check, but would immediately success on the first poll once spawned in thread pool as a Future.
To address this issue, we need to remove the assertion from untrack_task()
The text was updated successfully, but these errors were encountered:
When running two
wrk
benchmarks one immediately after another, I almost always getBasically,
deno/src/resources.rs
Lines 199 to 208 in b2fb826
assert!(t.is_some());
fails.From my investigation,
deno/src/tokio_util.rs
Lines 64 to 86 in b2fb826
some connections immediately yields
Ok(futures::prelude::Async::Ready(t))
without ever yieldsOk(futures::prelude::Async::NotReady)
. Thus no task is waiting => assertion would fail.This happens because in
eager_unix
tcp_accept
,deno/src/eager_unix.rs
Lines 68 to 84 in b2fb826
It is possible that an accept attempt would yield
WouldBlock
on first check, but would immediately success on the firstpoll
once spawned in thread pool as a Future.To address this issue, we need to remove the assertion from
untrack_task()
The text was updated successfully, but these errors were encountered: