Experimentation: completing an experiment does not compute final results, while the docs say they are frozen as final

未关闭
#9,129 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
67/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
postgresql, python
领域
analytics, backend

调研方向

Trace the experiment completion endpoint and the results refresh endpoint described in the reproduction, then read the “Analyse an experiment” documentation page. Check what triggers the final results computation and how the five-minute refresh limit affects it. Done means completion makes results final without waiting for a later refresh, or the documentation and results page explain when that refresh is available.

由索引模型根据 Issue 内容生成。

描述

Describe the bug

After POST .../experiments/{id}/complete/, the results endpoint keeps returning the last snapshot from before completion, with is_final: false. Final results appear only after the next results refresh, which is still subject to the 5-minute limit counted from the last refresh before completion, and only if something requests it.

The "Analyse an experiment" page says that after ending an experiment "Results are frozen as final and the flag is unlocked." A user who ends an experiment and reads the results page straight away sees a non-final snapshot, and nothing finalises it unless they come back and refresh.

Observed on self-hosted v2.295.2 (CI_COMMIT_SHA 5369ece3ff3aefbd021d2496f82a7ce0e9cd04d6), Postgres warehouse.

Steps To Reproduce
  1. Create a multivariate flag (control plus blue, green), a metric and an experiment, start it, and send exposures for 300 identities with the Python SDK.
  2. POST .../results/refresh/ and read GET .../results/: is_final: false, with an as_of.
  3. POST .../complete/ with {"rollout_decision": "variant", "rollout_variant": <blue option id>}. ended_at is set.
  4. Read GET .../results/ 5 s and 60 s later, with no refresh requested: same as_of as in step 2, is_final: false.
  5. POST .../results/refresh/ straight away: HTTP 429, {"detail":"A refresh was requested recently. Try again later. Expected available in 239 seconds."}.
  6. After the limit, POST .../results/refresh/: the results now read is_final: true.
  7. A further refresh: HTTP 400, {"detail":"Results are final for this completed experiment."}.
Expected behavior

Either completing queues the final computation (so the results become final shortly after completion without another request, regardless of the refresh limit), or the docs and the results page say that final results need one more refresh after ending the experiment, and when it will be allowed.

How are you running Flagsmith
  • Self-hosted with Docker
主要语言
Python
星标
9.9k
派生
658
平均合并
1 天 15 小时
30 天内合并 PR
168

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Flagsmith/flagsmith 的其他 Issue

查看 Flagsmith/flagsmith 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。