8000 [SFN] Add support for Task Timeouts by MEPalma · Pull Request #8376 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

[SFN] Add support for Task Timeouts #8376

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

Merged
merged 15 commits into from
Jun 25, 2023
Merged

[SFN] Add support for Task Timeouts #8376

merged 15 commits into from
Jun 25, 2023

Conversation

MEPalma
Copy link
Contributor
@MEPalma MEPalma commented May 26, 2023

Add support for Task TimeoutSeconds and TimeoutSecondsPath and relevant test cases.

@MEPalma MEPalma added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label May 26, 2023
@MEPalma MEPalma self-assigned this May 26, 2023
@github-actions
Copy link
github-actions bot commented May 26, 2023

LocalStack Community integration with Pro

       2 files         2 suites   1h 30m 23s ⏱️
2 144 tests 1 823 ✔️ 321 💤 0
2 145 runs  1 823 ✔️ 322 💤 0

Results for commit 387016f.

♻️ This comment has been updated with latest results.

@coveralls
Copy link
coveralls commented Jun 21, 2023

Coverage Status

coverage: 82.688% (+0.05%) from 82.643% when pulling 387016f on MEP-sfn-timeout into 577f0dc on master.

@MEPalma MEPalma marked this pull request as ready for review June 21, 2023 18:10
@MEPalma MEPalma requested a review from dominikschubert as a code owner June 21, 2023 18:10
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.

A few nits/questions, otherwise LGTM 🚀

"Cause": "",
"error": {
"Error": "States.Timeout",
"Cause": ""
Copy link
Member

Choose a reason for hiding this comment

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

Did you observe any case where this wasn't just empty or is this a static thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did try to generate some cause message but was never able for "States.Timeout" errors.

"States": {
"Start": {
"Type": "Task",
"TimeoutSecondsPath": "$.TimeoutSecondsValue",
Copy link
Member

Choose a reason for hiding this comment

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

Please correct me if I'm wrong but I think I didn't see a test that has both a TimeoutSeconds as well as TimeoutSecondsPath field set. Might be good to add 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, there are no tests with both declared. This is because it is part of the linter logic which we do not support yet (for example: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields)

Comment on lines +179 to +181
thread = Thread(target=_exec_and_notify)
thread.start()
finished_on_time: bool = terminated_event.wait(timeout_seconds)
Copy link
Member

Choose a reason for hiding this comment

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

Need to be a bit more careful here regarding potential leaks.

It's not the nicest patterns but there's the FuncThread and/or TMP_THREADS concepts to keep track of started threads so that we can kill them on shutdown.

Let's keep it as is for now though and revisit the concurrency constructs in a separate project at a later stage 👍

@MEPalma MEPalma requested a review from steffyP as a code owner June 22, 2023 12:56
@MEPalma MEPalma merged commit 0caa19d into master Jun 25, 2023
@MEPalma MEPalma deleted the MEP-sfn-timeout branch June 25, 2023 11:04
@dfangl dfangl added this to the 2.2 milestone Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0