Open
Description
Your environment.
- Version: v0.1.30
What did you do?
RateController on the delay stats update doesn't use the internals state. Should we make a transition from the internal state, not from the current one (which is always increase actually)? Snippet from the rate_controller.go :
func (c *rateController) onDelayStats(ds DelayStats) {
now := time.Now()
if !c.init {
c.delayStats = ds
c.delayStats.State = stateIncrease
c.init = true
return
}
c.delayStats = ds
// Transition from the current state?
c.delayStats.State = c.delayStats.State.transition(ds.Usage)
if c.delayStats.State == stateHold {
return
}
// ... more logic
}
What did you expect?
Using the internal state (smth like this):
func (c *rateController) onDelayStats(ds DelayStats) {
now := time.Now()
if !c.init {
c.delayStats = ds
c.delayStats.State = stateIncrease
c.init = true
return
}
prev := c.delayStats
c.delayStats = ds
c.delayStats.State = prev.State.transition(ds.Usage)
if c.delayStats.State == stateHold {
return
}
// ... more logic
}
What happened?
Metadata
Metadata
Assignees
Labels
No labels