fix: poll_tick does not register waker if ready (#2276)

This commit is contained in:
Matthias Seitz
2023-04-16 22:45:57 +02:00
committed by GitHub
parent 348e7301a3
commit 581e9ffcc4
4 changed files with 6 additions and 0 deletions

View File

@ -1408,12 +1408,14 @@ impl Discv4Service {
// trigger self lookup
if self.config.enable_lookup && self.lookup_interval.poll_tick(cx).is_ready() {
let _ = self.lookup_interval.poll_tick(cx);
let target = self.lookup_rotator.next(&self.local_node_record.id);
self.lookup_with(target, None);
}
// re-ping some peers
if self.ping_interval.poll_tick(cx).is_ready() {
let _ = self.ping_interval.poll_tick(cx);
self.re_ping_oldest();
}

View File

@ -715,6 +715,8 @@ impl PeersManager {
}
if self.refill_slots_interval.poll_tick(cx).is_ready() {
// this ensures the manager will be polled periodically, see [Interval::poll_tick]
let _ = self.refill_slots_interval.poll_tick(cx);
self.fill_outbound_slots();
}

View File

@ -596,6 +596,7 @@ impl Future for ActiveSession {
if !progress {
if this.internal_request_timeout_interval.poll_tick(cx).is_ready() {
let _ = this.internal_request_timeout_interval.poll_tick(cx);
// check for timed out requests
if this.check_timed_out_requests(Instant::now()) {
let _ = this.to_session.clone().try_send(

View File

@ -262,6 +262,7 @@ where
this.pending_block.is_none() &&
!deadline_reached
{
let _ = this.interval.poll_tick(cx);
trace!("spawn new payload build task");
let (tx, rx) = oneshot::channel();
let client = this.client.clone();