Prevent multiple resume notifications on track (#334)

* Prevent multiple resume notifications on track

When returning previous allocation as is, reset change to none.
Ideally, would like to have change as a separate return and not in last
allocation. But, also prefer to have last allocation state. For now,
resetting change.

* log bandwidth estimate only on decrease
This commit is contained in:
Raja Subramanian
2022-01-12 23:19:56 +05:30
committed by GitHub
parent 5cdea4e15d
commit 017ed13338
3 changed files with 15 additions and 2 deletions
+4 -1
View File
@@ -687,10 +687,13 @@ func (s *StreamAllocator) maybeCommitEstimate() (isDecreasing bool) {
s.lastEstimateDecreaseTime = time.Now()
isDecreasing = true
}
if s.committedChannelCapacity > s.receivedEstimate {
s.params.Logger.Debugw("committing channel capacity(bps)", "from", s.committedChannelCapacity, "to", s.receivedEstimate)
}
s.committedChannelCapacity = s.receivedEstimate
s.lastCommitTime = time.Now()
s.params.Logger.Debugw("committing channel capacity", "capacity(bps)", s.committedChannelCapacity)
return
}