Restore check-status response parity - #247
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4608fda7-552e-4297-a493-96bbeac57614
There was a problem hiding this comment.
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: 10to check-status (202) responses and extend parity across async/sync clients. - Introduce
return_internal_server_error_on_failureto 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 offunc.HttpResponse.headers, use"Content-Type"consistently.
headers={
"content-type": "application/json",
"Location": payload["statusQueryGetUri"],
"Retry-After": "10",
},
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4608fda7-552e-4297-a493-96bbeac57614
There was a problem hiding this comment.
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_failureoption is threaded throughcreate_http_management_payload()andcreate_check_status_response(), but the deprecated v1 shimget_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 requestreturnInternalServerErrorOnFailure=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 shimget_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 requestreturnInternalServerErrorOnFailure=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
left a comment
There was a problem hiding this comment.
Reviewed the exact current head. No actionable issues remain.
Summary
Retry-After: 10header to async and sync check-status responsesreturn_internal_server_error_on_failureacross management payload and check-status APIsTesting
python -m pytest tests/azure-functions-durable -m "not dts and not azurite and not functions_e2e" -qpython -m flake8 azure-functions-durablepython -m flake8 tests/azure-functions-durableCloses #232