GCC: RateController does not use the internal state

Open
#271 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
go

Research direction

Start in pkg/gcc/rate_controller.go at rateController.onDelayStats and trace how c.delayStats.State is updated between delay-stat samples. Compare the current transition source with the expected internal state shown in the issue, then run the relevant existing GCC tests if available. Done means state transitions use the retained controller state and the behavior is covered by passing tests.

Written by the indexing model from the issue text.

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?
Dominant language
Go
Stars
147
Forks
103
Avg merge
2d 3h
Merged PRs (30d)
19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pion/interceptor

All issues in pion/interceptor

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.