Fix static loop counter in HybridABRManager and mutex unlock-before-r…#1338
Merged
Conversation
…ead in updateProfile - Bug #1: Replace static int loop with per-instance mRampupFromSteadyStateLoop in HybridABRManager::CheckRampupFromSteadyState, matching the new ABR implementation. - Bug #2: Move lock.unlock() after all mProfiles reads in updateProfile() for both legacy ABRManager and new abr/abr.cpp to prevent races during period transitions. - Add unit tests for per-instance loop independence and updateProfile iframe selection.
86fbe23 to
d54139a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes ABR state/race issues by making the steady-state ramp-up backoff counter instance-scoped in the Hybrid ABR path, and by ensuring updateProfile() keeps the profile mutex held until all mProfiles reads are complete (both legacy and new ABR implementations).
Changes:
- Replace a function-static ramp-up loop counter with a per-instance member (
mRampupFromSteadyStateLoop) inHybridABRManager::CheckRampupFromSteadyState. - Move
lock.unlock()to after allmProfilesreads inABRManager::updateProfile()in bothsupport/aampabr/ABRManager.cppandabr/abr.cpp. - Add unit tests for ramp-up loop independence and iframe profile selection behavior in
updateProfile().
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/utests/tests/AampAbrTests/AbrTests.cpp | Adds new unit tests for ramp-up loop independence and iframe profile selection in updateProfile(). |
| support/aampabr/HybridABRManager.h | Introduces per-instance mRampupFromSteadyStateLoop state for steady-state ramp-up. |
| support/aampabr/HybridABRManager.cpp | Uses mRampupFromSteadyStateLoop instead of a function-static counter when computing mMaxBufferCountCheck. |
| support/aampabr/ABRManager.cpp | Extends mutex hold in updateProfile() until after all mProfiles reads complete. |
| abr/abr.cpp | Extends mutex hold in updateProfile() until after all mProfiles reads complete (new ABR path). |
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Abhi-jith-S
pushed a commit
that referenced
this pull request
May 12, 2026
Reason for Change: Fix static loop counter in HybridABRManager and mutex unlock-before-read in updateProfile - Bug #1: Replace static int loop with per-instance mRampupFromSteadyStateLoop in HybridABRManager::CheckRampupFromSteadyState, matching the new ABR implementation. - Bug #2: Move lock.unlock() after all mProfiles reads in updateProfile() for both legacy ABRManager and new abr/abr.cpp to prevent races during period transitions. - Add unit tests for per-instance loop independence and updateProfile iframe selection. * Reason for Change: fixed test to cover intent Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com> --------- Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com> Co-authored-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
varatharajan568
pushed a commit
that referenced
this pull request
May 20, 2026
Reason for Change: Fix static loop counter in HybridABRManager and mutex unlock-before-read in updateProfile - Bug #1: Replace static int loop with per-instance mRampupFromSteadyStateLoop in HybridABRManager::CheckRampupFromSteadyState, matching the new ABR implementation. - Bug #2: Move lock.unlock() after all mProfiles reads in updateProfile() for both legacy ABRManager and new abr/abr.cpp to prevent races during period transitions. - Add unit tests for per-instance loop independence and updateProfile iframe selection. * Reason for Change: fixed test to cover intent Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com> --------- Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com> Co-authored-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.