Skip to content

fix: avoid redundant feature reloads during sticky bucket refresh#124

Open
vazarkevych wants to merge 1 commit into
growthbook:mainfrom
vazarkevych:fix/sticky-bucket-redundant-reloads
Open

fix: avoid redundant feature reloads during sticky bucket refresh#124
vazarkevych wants to merge 1 commit into
growthbook:mainfrom
vazarkevych:fix/sticky-bucket-redundant-reloads

Conversation

@vazarkevych

Copy link
Copy Markdown
Collaborator

What

_get_sticky_bucket_attributes() called _get_eval_context() once per sticky-bucket identifier attribute. _get_eval_context() runs _ensure_fresh_features()load_features(), so on the set_attributes() path (where the _is_updating_features guard is not set) this triggered N redundant feature reloads per refresh - one per identifier attribute - each re-running set_features() and the sticky-bucket service lookup.

How

  • Split context assembly into a side-effect-free _build_eval_context().
  • _get_eval_context() now = _ensure_fresh_features() + _build_eval_context(), so the main eval paths (run / eval_feature) keep lazy refresh unchanged.
  • _get_sticky_bucket_attributes() builds the context once via _build_eval_context() → no reloads during refresh.

Also hardened eval_prereqs(): a non-dict prerequisite condition is now skipped instead of crashing in evalCondition(...).items().

@vazarkevych vazarkevych requested a review from madhuchavva June 25, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant