From d9a2d5d606f8738cd7a76793742ee5009925fa00 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Fri, 24 Feb 2023 12:04:07 +0100 Subject: [PATCH] fixup: ensure bw limit is respected Lost meaning of return while factorizing schedulers. Fix it by checking limits after each call. Signed-off-by: Csaba Kiraly --- DAS/validator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DAS/validator.py b/DAS/validator.py index 2f4bf8e..4d5aa27 100644 --- a/DAS/validator.py +++ b/DAS/validator.py @@ -408,16 +408,24 @@ class Validator: # process node level send queue self.processSendQueue() + if self.statsTxInSlot >= self.bwUplink: + return # process neighbor level send queues in shuffled breadth-first order self.processPerNeighborSendQueue() + if self.statsTxInSlot >= self.bwUplink: + return # process possible segments to send in shuffled breadth-first order if self.segmentShuffleScheduler: self.runSegmentShuffleScheduler() + if self.statsTxInSlot >= self.bwUplink: + return if self.dumbRandomScheduler: self.runDumbRandomScheduler() + if self.statsTxInSlot >= self.bwUplink: + return def logRows(self): """It logs the rows assigned to the validator."""