[Multi-provider] Gaps identified relative to js-sdk reference implementation
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu từ triển khai Python MultiProvider trong #511 và kiểm tra việc xử lý sự kiện, get_provider_hooks(), FirstMatchStrategy và các luồng đánh giá run_mode của nó. So sánh từng điểm thiếu với các tài liệu tham chiếu được liên kết của js-sdk, go-sdk và dotnet-sdk. Được coi là hoàn tất khi triển khai và kiểm thử hành vi được chỉ định về trạng thái, hook, chiến lược, so sánh và đánh giá song song, đồng thời để việc tracking được hoãn lại sau #374.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
We conducted a cross-SDK comparison of all MultiProvider implementations using the js-sdk as the reference. The Python MultiProvider was implemented in #511 and is functional for basic use cases, but we identified several gaps relative to the reference implementation. Some of these were noted as future work in the original PR.
Note: Tracking forwarding is blocked by SDK-level tracking support (#374).
Gaps
1. Event aggregation and status tracking (High)
The MultiProvider passes child provider events through directly via attach/detach with no aggregation. If one child emits PROVIDER_ERROR while another is READY, both events propagate independently. There is no composite status, so consumers cannot determine the overall health of the MultiProvider.
Expected behavior:
- Maintain a per-provider status map
- Compute an aggregate status using "worst-wins" precedence:
FATAL > NOT_READY > ERROR > STALE > READY - Only emit an event when the aggregate status actually changes (deduplication)
- Always forward
PROVIDER_CONFIGURATION_CHANGEDevents as a pass-through
Reference: js-sdk status-tracker.ts, dotnet-sdk HandleProviderEventAsync / DetermineAggregateStatus
2. Per-provider hook isolation during evaluation (High)
Hooks are aggregated into a flat list via get_provider_hooks(), meaning ALL child provider hooks run for ALL evaluations regardless of which provider actually evaluated the flag. The js-sdk reference runs each provider's hooks only during that provider's evaluation, with an isolated context copy to prevent cross-provider mutation.
Expected behavior:
- Run each child provider's hooks only when that specific provider is being evaluated
- Isolate hook context per-provider to prevent cross-provider mutation
- Execute the full before/after/error/finally lifecycle per-provider
Reference: js-sdk hook-executor.ts, go-sdk isolation.go, dotnet-sdk ProviderExtensions.EvaluateAsync
3. FirstMatchStrategy semantics (Medium)
The current FirstMatchStrategy.should_use_result() accepts any result where reason != Reason.ERROR. It does not distinguish FLAG_NOT_FOUND from other error types. The js-sdk reference treats FLAG_NOT_FOUND as "skip to next provider" but halts on any other error.
Expected behavior:
FLAG_NOT_FOUNDshould cause fallthrough to the next provider- Any other error (e.g.
PARSE_ERROR,GENERAL) should halt evaluation and surface that error - A successful result should be returned immediately
Reference: js-sdk strategies/first-match-strategy.ts
4. Add FirstSuccessfulStrategy (Medium)
Only FirstMatchStrategy exists. There is no FirstSuccessfulStrategy, which is more resilient by skipping all errors (including non-FLAG_NOT_FOUND errors) and continuing to the next provider.
Expected behavior:
- Return the first completely successful result (no error at all)
- Skip any provider that returns an error or throws, regardless of error type
- If all providers fail, collect and report all errors
Reference: js-sdk strategies/first-successful-strategy.ts
5. Add ComparisonStrategy (Medium)
There is no ComparisonStrategy for evaluating all providers and comparing results (useful for migration validation and consistency checks).
Expected behavior:
- Evaluate all providers (ideally in parallel)
- If all providers agree on the value, return it
- If providers disagree, call an optional
onMismatchcallback and return the designated fallback provider's result - If any provider errors, collect and report all errors
- Constructor accepts a
fallbackProviderand optionalonMismatchcallback
Reference: js-sdk comparison-strategy.ts, go-sdk comparison_strategy.go, dotnet-sdk ComparisonStrategy.cs
6. True parallel evaluation (Low)
The run_mode="parallel" option currently executes providers sequentially in a for-loop despite the name. The only difference from "sequential" is the lack of early exit. The docstring acknowledges this as a planned future enhancement.
Expected behavior:
- When
run_mode="parallel", evaluate all providers concurrently (e.g. viaasyncio.gatherorThreadPoolExecutor) - Collect all results, then let the strategy determine the final result
Reference: js-sdk parallel evaluation in flagResolutionProxy
Blocked / Deferred
- Tracking forwarding: Requires SDK-level tracking support first (#374)
Related Issues
- #511 — Original multi-provider implementation
- #374 — Implement tracking in Python
Spec Reference
https://openfeature.dev/specification/appendix-a/#multi-provider
- Ngôn ngữ chính
- Python
- Star
- 111
- Fork
- 44
- Merge trung bình
- 2 giờ 37 phút
- Pull request đã merge (30 ngày)
- 14
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của open-feature/python-sdk
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
open-feature/python-sdk#628 ·
-
question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
open-feature/python-sdk#627 ·
-
Spec v0.9.0 compliance Đang mởv0.9.0
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
open-feature/python-sdk#618 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
open-feature/python-sdk#615 ·
-
Support isolated API instances Đang mở
open-feature/python-sdk#584 · 1 người được giao ·
Tất cả issue của open-feature/python-sdk
Issue tương tự
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Đang mởarea: harness bug status: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Human-Agent-Society/reef#625 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
learningequality/kolibri#15351 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Name consistency Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eellak/triplestore#65 · 1 bình luận ·