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

[task scheduling] add intermediate Pending state and update policy #11985

Merged
merged 4 commits into from
Feb 14, 2024

Conversation

zzstoatzz
Copy link
Contributor

@zzstoatzz zzstoatzz commented Feb 14, 2024

based on discussion, we should:

  • have autonomous task runs go from SCHEDULED -> PENDING -> RUNNING
  • prevent PENDING -> PENDING (using the existing PreventPendingTransitions rule) instead of RUNNING -> RUNNING

Copy link

netlify bot commented Feb 14, 2024

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit f20f801
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/65cd235d6121bd0008241f8f
😎 Deploy Preview https://deploy-preview-11985--prefect-docs-preview.netlify.app
📱 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 self-assigned this Feb 14, 2024
@zzstoatzz zzstoatzz marked this pull request as ready for review February 14, 2024 19:14
@zzstoatzz zzstoatzz requested a review from a team as a code owner February 14, 2024 19:14

if not state.is_pending():
logger.exception(
f"Aborted submission of task run {task_run.id!r} -"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The fact that we "submit" task runs to a task runner isn't something the user should have to grapple with, IMO, because the language overlaps with Task.submit(). Also, the user can't really do much about this and they didn't do something wrong, so I'd be inclined to log a warning message for them ("Aborted task run <>. The task may already be running.") and logging something at INFO or DEBUG with the server's response, which will basically look like gibberish anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated in f612197

src/prefect/task_server.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

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

That looks exactly how I expected it, nice!

@zzstoatzz zzstoatzz merged commit c07bd63 into main Feb 14, 2024
43 of 44 checks passed
@zzstoatzz zzstoatzz deleted the additional-state-transition branch February 14, 2024 21:11
@serinamarie serinamarie added the enhancement An improvement of 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
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants