Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Single event notification is being yielded every time with `wait_for_external_event`

Đang mở
#507 3 bình luận 4 reaction 0 người được giao Xem trên GitHub

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
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python

Hướng nghiên cứu

Bắt đầu với entry point wait_for_external_event và tái hiện hành vi bằng repository mẫu được liên kết cùng OrchestrationHistory.csv. Xác minh rằng một event được phát ra trước khi chờ sẽ được tiêu thụ một lần, rằng wait thứ hai sẽ block để chờ một event trong tương lai, và rằng orchestrator không còn đệ quy cho đến khi vượt quá độ sâu đệ quy tối đa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug fixed-in-v2 P1

🐛 Describe the bug
When an event notification is raised for an orchestrator that is not yet waiting, then using wait_for_external_event multiple times will always yield that same specific initial event.

A typical scenario when this might happen is when multiple event notifications are raised at the same time by other orchestrators and the main orchestrator would not be waiting during handling of the first event.

🤔 Expected behavior
The expected behavior is that a single event notification only yields a single wait_for_external_event. This does work as expected for event notifications that were submitted after an orchestrator already started to wait for the external event, but not for notification events that were scheduled before waiting for the external event.

☕ Steps to reproduce

I have been able to reproduce the issue in a small example as seen below.

Sample repository: https://github.com/arjendev/durable-functions-python-external-events-issue-sample
Sample orchestration history: https://github.com/arjendev/durable-functions-python-external-events-issue-sample/blob/main/OrchestrationHistory.csv

myApp = df.DFApp(http_auth_level=func.AuthLevel.ANONYMOUS)

@myApp.route(route="orchestrators/{functionName}")
@myApp.durable_client_input(client_name="client")
async def http_start(req: func.HttpRequest, client: DurableOrchestrationClient):
    function_name = req.route_params.get('functionName')
    instance_id = await client.start_new(function_name)
    response = client.create_check_status_response(req, instance_id)
    return response

# Orchestrator
@myApp.orchestration_trigger(context_name="context")
def hello_orchestrator(context: DurableOrchestrationContext):
    yield context.call_activity("raise_my_durable_event", context.instance_id)
    while True:
        yield context.wait_for_external_event("my-durable-event")

# Activity
@myApp.activity_trigger(input_name="instance", activity="raise_my_durable_event")
@myApp.durable_client_input(client_name="client")
async def raise_my_durable_event(client: DurableOrchestrationClient, instance):
    await client.raise_event(instance, "my-durable-event")

The expected behavior of execution of the orchestrator would be:

  1. Start the orchestrator through the http_trigger
  2. Main orchestrator starts and raises an event notification with name: my-durable-event
  3. Main orchestrator enters the while loop and starts waiting for external events and immediately yields the already scheduled event notification
  4. Main orchestrator halts in the second iteration of the while loop and waits for future events

However, on step 4, the wait_for_external_event keeps returning the initial event and thus the while loop runs forever with the eventual error: Orchestrator function 'hello_orchestrator' failed: maximum recursion depth exceeded in comparison.

Ngôn ngữ chính
Python
Star
157
Fork
70
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/azure-functions-durable-python

Tất cả issue của Azure/azure-functions-durable-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.