Fix stuck backfill when scheduled work queue is at capacity (#5575)

* Fix stuck backfill and add regression test.

* Remove unnecessary `yield_now`

* Merge branch 'unstable' into fix-stuck-backfill

* Revert previous change and add extra comment.

* Merge branch 'unstable' into fix-stuck-backfill

* Update tests to use configured event schedule instead of hard coded values.

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into fix-stuck-backfill
This commit is contained in:
Jimmy Chen
2024-04-23 02:06:46 +10:00
committed by GitHub
parent f7aca97a55
commit 532206e008
4 changed files with 142 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
use super::SlotClock;
use parking_lot::RwLock;
use std::ops::Add;
use std::sync::Arc;
use std::time::Duration;
use types::Slot;
@@ -41,6 +42,11 @@ impl ManualSlotClock {
*self.current_time.write() = duration;
}
pub fn advance_time(&self, duration: Duration) {
let current_time = *self.current_time.read();
*self.current_time.write() = current_time.add(duration);
}
pub fn advance_slot(&self) {
self.set_slot(self.now().unwrap().as_u64() + 1)
}