-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[SFN] No Output Reductions for Successful Catch Blocks #11552
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
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 29m 31s ⏱️ - 1h 5m 16s Results for commit f5ece05. ± Comparison against base commit 5271fc0. This pull request removes 2403 and adds 10 tests. Note that renamed tests count towards both.
This pull request removes 246 skipped tests and adds 6 skipped tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a question on simplifying the statemachine and whether we are including all necessary test-cases for these changes.
...templates/errorhandling/statemachines/task_service_lambda_invoke_catch_all_output_path.json5
Show resolved
Hide resolved
localstack-core/localstack/services/stepfunctions/asl/component/state/state.py
Outdated
Show resolved
Hide resolved
if isinstance(output, CatcherOutput): | ||
env.inp = copy.deepcopy(output) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kudos on this clean solution, wow!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I've been struggling for hours to understand what was going on here as I believe Step Functions Catch on custom errors is effectively broken due to this :)
...templates/errorhandling/statemachines/task_service_lambda_invoke_catch_all_output_path.json5
Show resolved
Hide resolved
self.comment = None | ||
self.input_path = InputPath(InputPath.DEFAULT_PATH) | ||
self.output_path = OutputPath(OutputPath.DEFAULT_PATH) | ||
self.output_path = OutputPath(OutputPath.DEFAULT_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double assignment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.output_path = OutputPath(OutputPath.DEFAULT_PATH) |
Motivation
When an error in a state is successfully handled by a catch block, the error object containing the error message and cause string is directly passed as the state's output. This means that if the user defines output reduction logic, such as ResultPath and OutputPath, these are not applied. However, the current implementation of the SFN v2 interpreter mistakenly applies these reductions, which can lead to JsonPath errors and disrupt the state machine's logic, as seen in issue #11494.
These changes type the output handling for successful catch blocks so these can be detected and bypass output reductions.
Changes