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

Offen
#9,129 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
67/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
postgresql, python
Bereich
analytics, backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
Python
Sterne
9.9k
Forks
658
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
168

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Flagsmith/flagsmith

Alle Issues in Flagsmith/flagsmith

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.