Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow try-catching Entity exceptions in orchestrators #324

Merged
merged 4 commits into from
Sep 24, 2021

Conversation

davidmrdavid
Copy link
Collaborator

We were recently notified that entity exceptions were not try-catch'able in orchestrator code. The reason for this was that we didn't really have logic to differentiate between a successful and an error'ing entity. This PR fixes this by correctly de-serializing entity exceptions and re-throwing them in the replay.

Tests were also added to prevent future regressions in this area.

@davidmrdavid
Copy link
Collaborator Author

FYI @sebastianburckhardt

Copy link

@ConnorMcMahon ConnorMcMahon left a comment

Choose a reason for hiding this comment

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

Looks good, just have a minor nit for tests to improve clarity.

entityId = df.EntityId("Counter", "myCounter")
try:
yield context.call_entity(entityId, "add", 3)
return "Failure"

Choose a reason for hiding this comment

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

Personally, it is a bit confusing to have the "not exception thrown" path return "failure" and the exception thrown path return "Success". I understand that this is because these test cases are trying to prove that an exception is thrown, but it may be more clear to just change the strings to "No exception thrown" and "Exception thrown".

@davidmrdavid davidmrdavid merged commit 44f6a95 into dev Sep 24, 2021
@davidmrdavid davidmrdavid deleted the dajusto/entity-exceptions branch September 24, 2021 17:41
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