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

SFN: Allow ProgramError without details #10400

Merged
merged 1 commit into from Mar 19, 2024
Merged

Conversation

bblommers
Copy link
Contributor

Motivation

Bugfix in how SFN handles an ErrorState without any details.

Testing

Example template that I've used to verify this works against AWS:

{
  "StartAt": "ChoiceStateX",
  "States": {
    "ChoiceStateX": {
      "Type": "Choice",
      "Choices": [
        {
          "And": [{"Variable": "$.type", "StringEquals": "Public"}],
          "Next": "Public"
        }
      ],
      "Default": "DefaultState"
    },
    "Public": {"Type": "Pass", "End": true},
    "DefaultState": {
      "Type": "Fail"
    }
  }
}

Note the DefaultState at the end; it does not have an error or cause, and AWS will accept this (and simply return 'cause': None, 'error': None)

StackTrace

This is what it looks like without these fixes:

Traceback (most recent call last):
    File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
      self.run()
    File "/usr/lib/python3.10/threading.py", line 953, in run
      self._target(*self._args, **self._kwargs)
    File "/.../stepfunctions/backend/execution_worker.py", line 76, in _execution_logic
      self._exec_comm.terminated()
    File "/.../stepfunctions/backend/execution.py", line 68, in terminated
      self.execution.error = exit_program_state.error["error"]
  KeyError: 'error'
  
    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

Copy link
Collaborator

@localstack-bot localstack-bot left a comment

Choose a reason for hiding this comment

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

Welcome to LocalStack! Thanks for raising your first Pull Request and landing in your contributions. Our team will reach out with any reviews or feedbacks that we have shortly. We recommend joining our Slack Community and share your PR on the #community channel to share your contributions with us. Please make sure you are following our contributing guidelines and our Code of Conduct.

@localstack-bot
Copy link
Collaborator

localstack-bot commented Mar 5, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@bblommers
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@bblommers bblommers added the semver: patch Non-breaking changes which can be included in patch releases label Mar 5, 2024
@coveralls
Copy link

coveralls commented Mar 5, 2024

Coverage Status

coverage: 83.469% (-2.4%) from 85.885%
when pulling af00016 on bblommers-patch-1
into cc55cb4 on master.

Copy link

github-actions bot commented Mar 5, 2024

LocalStack Community integration with Pro

    2 files      2 suites   1h 24m 56s ⏱️
2 691 tests 2 435 ✅ 256 💤 0 ❌
2 693 runs  2 435 ✅ 258 💤 0 ❌

Results for commit af00016.

♻️ This comment has been updated with latest results.

@MEPalma
Copy link
Contributor

MEPalma commented Mar 5, 2024

Thank you @bblommers! Could we please have a snapshot test for this scenario

@bblommers
Copy link
Contributor Author

Hi @MEPalma! There is a test for this exact scenario, actually, so I decided to just extend the test to also capture the describe_execution call, as that is the operation that showcases the problem.

Let me know if you're OK with this approach - this change seemed the least invasive to me.

Copy link
Contributor

@MEPalma MEPalma left a comment

Choose a reason for hiding this comment

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

Thanks again!

@alexrashed alexrashed merged commit da0076d into master Mar 19, 2024
28 of 29 checks passed
@alexrashed alexrashed deleted the bblommers-patch-1 branch March 19, 2024 10:03
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.

None yet

5 participants