Skip to content

Conversation

nytian
Copy link
Contributor

@nytian nytian commented Apr 16, 2024

Fix issue #428

If the orchestrator output includes any type that cannot be serialized into JSON, it will trigger a non-deterministic error. This occurs because the orchestration state must be serialized before it is sent to the durable extension. If there is a serialization issue, the extension cannot replay correctly from this corrupted state, thus treating the situation as non-deterministic. The fix in this PR is to verify whether the orchestration output is serializable. If it is not, an exception will be thrown to indicate that this type of return is not accepted in durable Python.

Noting E2E test,

image

Orchestrator return includes a exception object.

Former return:
image

Return with changes in this PR:
image

@nytian nytian marked this pull request as ready for review April 17, 2024 22:25
@nytian nytian requested a review from davidmrdavid as a code owner April 17, 2024 22:25
@nytian
Copy link
Contributor Author

nytian commented Apr 17, 2024

I didn't add a test because the wrong error is returned from the durable extension level, not durable python repo. So I am not sure how to do a proper unit test. But I did the E2E test, and the error message is correct.

Copy link
Collaborator

@davidmrdavid davidmrdavid left a comment

Choose a reason for hiding this comment

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

Approved conditional on the self.output if statement checking specifically for None.

Thanks so much for fixing this!

@nytian nytian merged commit 3f0e168 into dev Apr 30, 2024
@davidmrdavid davidmrdavid deleted the nytian/error_return branch April 30, 2024 20:22
greenie-msft pushed a commit to greenie-msft/azure-functions-durable-python that referenced this pull request Sep 25, 2025
* initial commit

* remove blank line

* Remove unused pkg

* update by comments
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.

2 participants