Skip to content

Fix EMALong reviving stale value after idle period - #319

Open
pallavithegod wants to merge 1 commit into
apache:mainfrom
pallavithegod:fix-emalong-decayed-base-301
Open

pallavithegod wants to merge 1 commit into
apache:mainfrom
pallavithegod:fix-emalong-decayed-base-301

Conversation

@pallavithegod

Copy link
Copy Markdown

Summary

get() applies time-based decay without writing it back, but update() blended onto the raw undecayed value. After idle, get() reported low congestion while the next update() revived ~90 percent of the stale value.

Fix

  • Extract decay calculation into decay(state, now).
  • update() blends onto the decayed base; get() delegates to the same method. Reads stay side-effect free.
  • Add regression test updateAfterIdleUsesDecayedBase.

Fixes #301

Verification

  • EMALongTest: 8 tests, 0 failures.

get applies time-based decay without writing it back, but update
blended onto the raw undecayed value. Extract decay calculation
and use decayed base in update so get and update agree.

Fixes apache#301
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] EMALong.update() uses the undecayed value as its base, resurrecting stale congestion after an idle period

1 participant