Skip to content

Conversation

@MEPalma
Copy link
Contributor

@MEPalma MEPalma commented Apr 30, 2024

Motivation

Currently the StepFunctions v2 interpreter is unable of handling empty SentTaskFailure api calls. These are SendTaskFailure messages for waitForTaskToken tasks which do not provide an error string. Such calls would result in internal States.Runtime errors, and misleading error messages such as Custom Error Names MUST NOT begin with the prefix 'States.', got 'State.Runtime'. This PR adds snapshot tests replicating this occurrence and add support for CustomErrorNames to have nullable error strings. It also identifies need for future work on StateTaskAbort events logging.

Changes

  • Nullable error strings in CustomErrorName objects
  • Related handling of null error strings
  • Snapshot tests

@MEPalma MEPalma added the semver: patch Non-breaking changes which can be included in patch releases label Apr 30, 2024
@MEPalma MEPalma added this to the 3.5 milestone Apr 30, 2024
@MEPalma MEPalma requested a review from joe4dev April 30, 2024 07:26
@MEPalma MEPalma self-assigned this Apr 30, 2024
Copy link
Member

@dominikschubert dominikschubert left a comment

Choose a reason for hiding this comment

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

Mostly LGTM! Definitely another interesting edge case.

Changes requested is mostly referring to the thread handling which I'd like to verify before a final approval.

Comment on lines 718 to 725
if (
request.node.name
== "test_sqs_failure_in_wait_for_task_tok_no_error_field[SQS_PARALLEL_WAIT_FOR_TASK_TOKEN]"
):
# TODO: The conditions in which TaskStateAborted error events are logged requires further investigations.
# These appear to be logged for Task state workers but only within Parallel states. The behaviour with
# other 'Abort' errors should also be investigated.
pytest.skip("Investigate occurrence logic of 'TaskStateAborted' errors")
Copy link
Member

Choose a reason for hiding this comment

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

Is this also not working against AWS or just localstack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works against AWS. For LocalStack I first want to collect more insight into when it is triggered before updating the interpreter

Copy link
Member

Choose a reason for hiding this comment

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

nit: You could in this case extend the if case by a check against is_aws_cloud() as well to make sure we only skip it when running against LS

@MEPalma MEPalma requested a review from dominikschubert April 30, 2024 08:13
@github-actions
Copy link

github-actions bot commented Apr 30, 2024

LocalStack Community integration with Pro

    2 files      2 suites   1h 34m 13s ⏱️
2 924 tests 2 633 ✅ 291 💤 0 ❌
2 926 runs  2 633 ✅ 293 💤 0 ❌

Results for commit ee13a0b.

♻️ This comment has been updated with latest results.

Copy link
Member

@dominikschubert dominikschubert left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for addressing the previous points. Minor nit regarding the test skip, but generally good to go from my side :)

Comment on lines 718 to 725
if (
request.node.name
== "test_sqs_failure_in_wait_for_task_tok_no_error_field[SQS_PARALLEL_WAIT_FOR_TASK_TOKEN]"
):
# TODO: The conditions in which TaskStateAborted error events are logged requires further investigations.
# These appear to be logged for Task state workers but only within Parallel states. The behaviour with
# other 'Abort' errors should also be investigated.
pytest.skip("Investigate occurrence logic of 'TaskStateAborted' errors")
Copy link
Member

Choose a reason for hiding this comment

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

nit: You could in this case extend the if case by a check against is_aws_cloud() as well to make sure we only skip it when running against LS

@MEPalma MEPalma merged commit 0da9865 into master May 1, 2024
@MEPalma MEPalma deleted the MEP-sfn-fix_unrelated_runtime_error_messages branch May 1, 2024 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants