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

Add optional timeout to workflow steps #1012

Open
osterman opened this issue Feb 4, 2025 · 0 comments
Open

Add optional timeout to workflow steps #1012

osterman opened this issue Feb 4, 2025 · 0 comments

Comments

@osterman
Copy link
Member

osterman commented Feb 4, 2025

Describe the Feature

Steps in workflow can hang.

When the timeout is set, it will abort the step. If there is a retry configured and max retires is not reached. It will retry

We should support human friendly time expressions.

Update the docs for workflows and custom commands with the new field

https://atmos.tools/core-concepts/workflows/

Implement a tests to verify the behavior.

workflows:
  super-slow-workflow:
    description: "Test timeouts"
    steps:
      - name: step1
        type: shell
        command: sleep 0.5
        
      - name: step2
        type: shell
        timeout: 1s
        command: sleep 2

Expected Behavior

When the optional timeout parameter is set, and the commands execution time exceeds this timeout, the command is forcefully killed.

Use Case

Sometimes commands can hang. Someone unaccustomed to running the workflow might not know what a reasonable amount of time is to wait. Adding a timeout, ensures that the command will abort after some known amount of time.

Describe Ideal Solution

Support human readable timeouts.

ms, s, m, h, etc We do this else where in atmos. Let's reuse the function.

Further more, if no modifier is specified, we should assume the timeout is in seconds.

workflows:
  super-slow-workflow:
    description: "Test timeouts"
    steps:
      - name: step1
        type: shell
        command: sleep 0.5
        timeout: 100ms

Alternatives Considered

We could use another command like the timeout command on Linux and Mac, but the execution interface is not uniform. We want workflows to work easily across multiple platforms.

Additional Context

No response

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

No branches or pull requests

1 participant