mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 12:58:31 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user