Skip to content

Restore check-status response parity - #247

Merged
berndverst merged 2 commits into
mainfrom
andystaples-restore-status-parity
Jul 29, 2026
Merged

Restore check-status response parity#247
berndverst merged 2 commits into
mainfrom
andystaples-restore-status-parity

Conversation

@andystaples

Copy link
Copy Markdown
Contributor

Summary

  • add the standard Retry-After: 10 header to async and sync check-status responses
  • support return_internal_server_error_on_failure across management payload and check-status APIs
  • return failed orchestration status as HTTP 200 by default, with opt-in HTTP 500 behavior preserved through timeout polling URLs

Testing

  • python -m pytest tests/azure-functions-durable -m "not dts and not azurite and not functions_e2e" -q
  • python -m flake8 azure-functions-durable
  • python -m flake8 tests/azure-functions-durable

Closes #232

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4608fda7-552e-4297-a493-96bbeac57614
Copilot AI review requested due to automatic review settings July 29, 2026 20:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the azure-functions-durable provider’s HTTP management payload and check-status response helpers to match the Durable Functions host’s behavior for polling headers and failed-orchestration status codes (Issue #232).

Changes:

  • Add Retry-After: 10 to check-status (202) responses and extend parity across async/sync clients.
  • Introduce return_internal_server_error_on_failure to consistently control whether failed orchestrations surface as HTTP 200 (default) or HTTP 500 (opt-in), including preserved behavior through timeout polling URLs.
  • Expand compatibility tests to cover async/sync parity, timeout URL preservation, and terminal-state behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
azure-functions-durable/azure/durable_functions/client.py Adds polling header + new failure-status option to check-status, management payload, and wait helper paths for both async and sync clients.
azure-functions-durable/azure/durable_functions/http/http_management_payload.py Appends returnInternalServerErrorOnFailure=true to statusQueryGetUri when requested.
tests/azure-functions-durable/test_client_compat.py Adds coverage for the new option, polling headers, timeout URL preservation, and terminal-state responses across async/sync clients.
azure-functions-durable/CHANGELOG.md Documents the user-facing behavior changes under FIXED.
Comments suppressed due to low confidence (1)

azure-functions-durable/azure/durable_functions/client.py:710

  • Sync create_check_status_response() uses the lowercase header key "content-type". To keep async/sync parity and avoid relying on case-normalization of func.HttpResponse.headers, use "Content-Type" consistently.
            headers={
                "content-type": "application/json",
                "Location": payload["statusQueryGetUri"],
                "Retry-After": "10",
            },

Comment thread azure-functions-durable/azure/durable_functions/client.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4608fda7-552e-4297-a493-96bbeac57614
Copilot AI review requested due to automatic review settings July 29, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

azure-functions-durable/azure/durable_functions/client.py:552

  • The new return_internal_server_error_on_failure option is threaded through create_http_management_payload() and create_check_status_response(), but the deprecated v1 shim get_client_response_links() (used by v1-style apps) still can’t accept/propagate the option. That leaves a backwards-compatibility gap where v1 callers can’t request returnInternalServerErrorOnFailure=true. Consider updating the shim signature to accept the flag and pass it through to _get_client_response_links().
            request: func.HttpRequest,
            instance_id: str,
            timeout_in_milliseconds: int = 10000,
            retry_interval_in_milliseconds: int = 1000,
            return_internal_server_error_on_failure: bool = False

tests/azure-functions-durable/test_client_compat.py:227

  • This new test validates the flag for create_http_management_payload(), but the v1-style shim get_client_response_links() is still a common entrypoint (see the existing delegation test later in this file). To fully cover the parity goal, consider extending this test to also assert that the deprecated shim can request returnInternalServerErrorOnFailure=true (at least for the async client).
        payload = client.create_http_management_payload(
            _make_request(),
            "inst",
            return_internal_server_error_on_failure=True)
        assert payload["statusQueryGetUri"] == (

@berndverst berndverst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the exact current head. No actionable issues remain.

@berndverst
berndverst merged commit 85e804a into main Jul 29, 2026
25 checks passed
@berndverst
berndverst deleted the andystaples-restore-status-parity branch July 29, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore check-status response parity for polling and failed orchestrations

3 participants