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

prevent RUNNING -> RUNNING for autonomous task runs #11975

Merged
merged 13 commits into from
Feb 13, 2024

Conversation

zzstoatzz
Copy link
Contributor

@zzstoatzz zzstoatzz commented Feb 13, 2024

This PR adds an AutonomousTaskPolicy that includes a new PreventRunningToRunningTransitions rule to be conditionally applied for autonomous task runs.

Similar to the idea behind #9447, this is primarily to address potential race conditions where the same task run is picked up by more than one TaskServer and submitted to the engine.

Since task runs are created in Pending and transitioned to Running by the engine, we should gracefully abort any subsequent attempt to transition an already Running task run into Running.

Example

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.

For documentation changes:

  • This pull request includes redirect settings in netlify.toml for files that are removed or renamed.

For new functions or classes in the Python SDK:

  • This pull request includes helpful docstrings.
  • If a new Python file was added, this pull request contains a stub page in the Python SDK docs and an entry in mkdocs.yml navigation.

Copy link

netlify bot commented Feb 13, 2024

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit d39bbe5
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/65cbc323186ebe0008c67082
😎 Deploy Preview https://deploy-preview-11975--prefect-docs-preview.netlify.app/api-ref/server/orchestration/core_policy
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@zzstoatzz zzstoatzz changed the title prevent Running -> Running for autonomous task runs specifically prevent Running -> Running for autonomous task runs Feb 13, 2024
@zzstoatzz zzstoatzz changed the title prevent Running -> Running for autonomous task runs prevent Pending -> Pending for autonomous task runs Feb 13, 2024
@zzstoatzz zzstoatzz changed the title prevent Pending -> Pending for autonomous task runs prevent RUNNING -> RUNNING for autonomous task runs Feb 13, 2024
@zzstoatzz zzstoatzz marked this pull request as ready for review February 13, 2024 19:39
@zzstoatzz zzstoatzz requested review from a team and zangell44 as code owners February 13, 2024 19:39
@zzstoatzz zzstoatzz merged commit f69eec7 into main Feb 13, 2024
44 checks passed
@zzstoatzz zzstoatzz deleted the prevent-task-runs-running-to-running branch February 13, 2024 21:54
@serinamarie serinamarie added the fix A fix for a bug in an existing feature label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug in an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants