Python Durable Functions on DTS: oversized orchestrator completion fails the orchestration invisibly, and large-payload externalization can't be enabled
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- json, python
- Lĩnh vực
- api, backend, cloud, distributed-systems
Hướng nghiên cứu
The issue is in the azure-functions-durable Python SDK, specifically around orchestrator completion handling and payload serialization. Look at the DurableFunctionsWorker and DurableFunctionsClient construction in the SDK code, and the df_dumps function for JSON serialization. The large-payload externalization feature in durabletask (payload_store) needs to be integrated. Start by examining the error flow when an oversized completion request is rejected by the scheduler, and see where exceptions are lost. Check the history and logging discrepancy. The fix involves changes to the SDK's initialization and serialization paths.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
- Azure Functions, Python 3.14, Elastic Premium,
storageProvider.type: "azureManaged"(Durable Task Scheduler) azure-functions-durable==2.0.0rc1(ondurabletask==1.10.1),azure-functions==2.3.0- Durable extension 3.14.0 via
Microsoft.Azure.Functions.ExtensionBundle.Preview [4.29.0, 5.0.0)
We have an instance ID and task-hub details for a production occurrence and can share them privately.
What happened
An orchestrator fanned out 121 activities; each result was 2–48 KB. When the last one completed, the orchestrator scheduled one more activity whose input was the fanned-in result list. The scheduler rejected that episode and marked the orchestration Failed:
runtimeStatus: FAILED
failureDetails.errorType: InvalidOperationException
failureDetails.message: The complete orchestration work item request of size 11.05MB exceeds the 3.90MB limit.
Enable large-payload externalization to Azure Blob Storage to support oversized completion requests.
ExecutionCompletedEvent: orchestration_status 3, isNonRetriable: true
(Retrieved with DurableTaskSchedulerClient.get_orchestration_state(fetch_payloads=True) and get_orchestration_history().)
Problems
- The failure never reaches the app. No exception surfaces in orchestrator code, so our
try/exceptcompensation (refund, user notification) never ran. The host and Application Insights log nothing. The last host line for the instance isOrchestrator orchestrate_process_document yielded with 1 task(s) and 0 event(s) outstanding. The failure exists only in scheduler state, and our users see a review stuck in "processing". - The rejected episode's triggering completion isn't in history. History has 121
TaskScheduledevents but only 120TaskCompleted. The missing completion is the activity whose result triggered the rejected episode, and the host logged that activity asCompleted. We assume this follows from the work item being rejected as a unit, but it means history and host logs disagree. - The 3.90 MB limit isn't documented. The published DTS limits describe 1 MB per activity input/output. The cap on the orchestrator completion request, and the fact that scheduled-activity inputs count toward it, aren't documented anywhere we found. Our code had assumed the orchestrator→activity direction was safe.
- The suggested fix isn't available to us. The error message recommends large-payload externalization.
durabletask1.10.1 has it (durabletask[azure-blob-payloads]), and its worker externalizesOrchestratorResponsepayloads when given apayload_store. Butazure-functions-durable2.0.0rc1 constructsDurableFunctionsWorkerandDurableFunctionsClientwithout one, and exposes no way to pass one. The large payload docs confirm Durable Functions support is .NET-isolated only. - Serialization inflates payloads for non-Latin text. The stored activity results were 2.55 MB of UTF-8 (mostly Cyrillic), but the request was 11.05 MB.
azure.functions._durable_functions.df_dumpscallsjson.dumpswith the defaultensure_ascii=True, so each Cyrillic character becomes a 6-byte\uXXXXescape instead of 2 bytes of UTF-8.
Asks
- Deliver an oversized orchestrator completion as a failure the orchestrator can catch, or at least log it on the Functions host with the instance ID.
- Document the completion-request limit, and that scheduled-activity inputs count toward it.
- Is large-payload support planned for
azure-functions-durable(Python) on DTS? We'd be glad to contribute a PR. Our rough plan:- accept a
PayloadStoreinDFAppor via app settings, and pass it toDurableFunctionsWorkerandDurableFunctionsClient. The orchestrator and entity paths then externalize through the existingdurabletaskhooks, which alone would have prevented the failure above. - in the
activity_triggerwrapper, resolve token inputs before calling the user function, and externalize outputs over the threshold. The open question is how the token should survivedf_dumpsJSON-quoting on the output side, so thatdeexternalize_payloadsrecognizes it inTaskCompleted.result. We'd like your preference before writing that part.
- accept a
- Would you accept
ensure_ascii=Falseindf_dumps? It's valid JSON and cuts non-Latin payloads about 3×, but it changes the bytes on the wire, so we'd rather ask first.
- Ngôn ngữ chính
- Python
- Star
- 40
- Fork
- 33
- Merge trung bình
- 7 giờ 54 phút
- Pull request đã merge (30 ngày)
- 5
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 microsoft/durabletask-python
-
[Azure Functions] Simplify large-payload configuration by reusing an existing storage connection Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
microsoft/durabletask-python#271 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
microsoft/durabletask-python#268 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
microsoft/durabletask-python#266 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
microsoft/durabletask-python#249 ·
-
bug Functions Parity
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/durabletask-python#241 · 2 bình luận ·
Tất cả issue của microsoft/durabletask-python
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 ·