Allow orchestrators to try-catch entity timeouts #328
Merged
+41
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows entity timeouts to be try-catched within orchestrators.
EDIT:
When an entity operation runs for too long, it runs the risk of being cancelled by the Functions Host due to it "timing out", that is, exceeding the maximum allowed execution time for a Function invocation. When this occurs, we consider the entity to have thrown an exception ( a timeout exception) and, as such, we expect to be able to try-catch it in the orchestrator. Currently, this doesn't happen.
To enable this scenario, there are changes required in the extension and in the SDK. Sebastian has been working on the extension changes in this branch and, using that branch's changes, this PR implements the SDK-level changes that are leftover.
In particular, during a time-out, the HistoryEvent corresponding to this exception doesn't follow the serialization rules that normally govern Entity execution and therefore they require an extra step (to serialize the exception one more time) before they can be parsed by the SDK. This PR does just that.